@@ -193,7 +193,7 @@ xwl_glamor_create_pixmap(ScreenPtr screen,
hint == CREATE_PIXMAP_USAGE_SHARED)) {
bo = gbm_bo_create(xwl_screen->gbm, width, height,
gbm_format_for_depth(depth),
- GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
+ GBM_BO_USE_RENDERING);
if (bo)
return xwl_glamor_create_pixmap_for_bo(screen, bo, depth);
@@ -538,7 +538,7 @@ xwl_dri3_pixmap_from_fd(ScreenPtr screen, int fd,
data.stride = stride;
data.format = gbm_format_for_depth(depth);
bo = gbm_bo_import(xwl_screen->gbm, GBM_BO_IMPORT_FD, &data,
- GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
+ GBM_BO_USE_RENDERING);
if (bo == NULL)
return NULL;
The second change is to force the XWayland root surface size to a magic
number as a quick & dirty way of marking it for special treatment by the
etnaviv gallium driver. If I understood correctly, a clean way of
communicating buffer layouts is coming with dri3 modifiers?
@@ -991,6 +991,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
miSetPixmapDepths();
+ /* magic number as signal to drm/etnaviv */
+ xwl_screen->width=1288;
+
ret = fbScreenInit(pScreen, NULL,
xwl_screen->width, xwl_screen->height,
96, 96, 0,
Finally, this hack makes etna_resource_from_handle recognize the buffer
and interpret its layout as ETNA_LAYOUT_SUPER_TILED. This unscrambles
the output and makes XWayland usable (there are still some glitches with
GLX applications, but that is another topic).
@@ -512,10 +512,15 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
rsc->layout = modifier_to_layout(handle->modifier);
rsc->halign = TEXTURE_HALIGN_FOUR;
level->width = tmpl->width0;
level->height = tmpl->height0;
+ /* magic number from xwayland */
+ if (level->stride == 5376) {
+ rsc->layout = ETNA_LAYOUT_SUPER_TILED;
+ }
+
/* Determine padding of the imported resource. */
unsigned paddingX = 0, paddingY = 0;
etna_layout_multiple(rsc->layout, screen->specs.pixel_pipes,