On 21 March 2018 at 02:07, Rob Clark <robdcl...@gmail.com> wrote: > On Tue, Mar 20, 2018 at 2:45 PM, Emil Velikov <emil.l.veli...@gmail.com> > wrote: >> On 20 March 2018 at 18:02, Christian Gmeiner >> <christian.gmei...@gmail.com> wrote: >>> Fixes rendering issues with mode rgba on etnaviv. I have applied >>> the same change for nv12 variants but they are not supported on >>> etnaviv. >>> >>> Signed-off-by: Christian Gmeiner <christian.gmei...@gmail.com> >>> --- >>> cube-tex.c | 32 ++++++++++++++++++++++++-------- >>> 1 file changed, 24 insertions(+), 8 deletions(-) >>> >>> diff --git a/cube-tex.c b/cube-tex.c >>> index 9e38ae8..dba19ff 100644 >>> --- a/cube-tex.c >>> +++ b/cube-tex.c >>> @@ -213,7 +213,7 @@ static const char *fragment_shader_source_2img = >>> >>> static const uint32_t texw = 512, texh = 512; >>> >>> -static int get_fd_rgba(uint32_t *pstride) >>> +static int get_fd_rgba(uint32_t *pstride, uint64_t *modifier) >>> { >>> struct gbm_bo *bo; >>> void *map_data = NULL; >>> @@ -234,6 +234,7 @@ static int get_fd_rgba(uint32_t *pstride) >>> gbm_bo_unmap(bo, map_data); >>> >>> fd = gbm_bo_get_fd(bo); >>> + *modifier = gbm_bo_get_modifier(bo); >>> >> Based on the existing gbm_bo_get_modifier handling there should be a guard >> here: >> >> #ifdef HAVE_GBM_MODIFIERS >> *modifier = ... >> #else >> *modifier = DRM_FORMAT_MOD_INVALID; >> #endif >> > > We probably *could* just require new enough version of gbm. But a > similar issue came up with $blob gles driver that did not support > gbm_bo_map(), and I'd suggested that we could probably start doing > __attribute__((weak)) fallbacks for new gbm fxns which returned errors > (or in this case DRM_FORMAT_MOD_LINEAR ?) to avoid making these things > build time configs.. > The weak trick sounds like a plan IMHO. I do recall suggesting that with the recent xcb-dri3 thingy ;-)
Also just remembered - we must check for the EGL extension EGL_EXT_image_dma_buf_import_modifiers before using EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT and friends. -Emil _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev