[Mesa-dev] [PATCH 2/7] egl: add support for EGL_ANDROID_blob_cache
Nicolai Hähnle
nhaehnle at gmail.com
Wed Jan 17 11:28:58 UTC 2018
On 16.01.2018 18:45, Emil Velikov wrote:
> Hi Tapani,
>
> On 15 January 2018 at 12:31, Tapani Pälli <tapani.palli at intel.com> wrote:
>
>> +static void
>> +update_blob_cache_functions(struct dri2_egl_display *dri2_dpy,
>> + struct dri2_egl_context *dri2_ctx)
>> +{
>> + if (!dri2_dpy || !dri2_ctx)
>> + return;
> AFAICT dri2_dpy can never be NULL.
>
>> +
>> + /* No blob support. */
>> + if (!dri2_dpy->blob)
>> + return;
>> +
>> + /* No functions to set. */
>> + if (!dri2_dpy->blob_cache_set)
>> + return;
>> +
>> + dri2_dpy->blob->set_cache_funcs(dri2_ctx->dri_context,
>> + dri2_dpy->blob_cache_set,
>> + dri2_dpy->blob_cache_get);
>> +}
>> +
> I'm wondering why you opted to make set_cache_funcs dri_context
> specific as opposed to dri_screen.
> The latter seems to align better to EGLDisplay.
>
> Plus doing so will simplify the existing code - no hunk in
> dri2_make_current, no dri2_dpy->blob/blob_cache_set checks, etc.
Yes, please make it a screen thing. It just makes more sense, and
there's precedent in Gallium, where the disk-cache is a per-pipe_screen
object as well.
Thanks,
Nicolai
>
>
>> @@ -230,6 +231,9 @@ struct dri2_egl_display
>>
>> bool is_render_node;
>> bool is_different_gpu;
>> +
>> + EGLSetBlobFuncANDROID blob_cache_set;
>> + EGLGetBlobFuncANDROID blob_cache_get;
> These two are part of the EGL API, so they are better suited in struct
> _egl_display.
>
> -Emil
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list