glamor_copyarea: Don't access a DRM only pixmap.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 25 Apr 2012 10:58:16 +0000 (18:58 +0800)
committerEric Anholt <eric@anholt.net>
Wed, 18 Dec 2013 19:23:50 +0000 (11:23 -0800)
As EGL image/gbm only support ARGB8888 image, we don't support
other format. We may change the way to use gbm directly latter.
But now, we have to face this limitation, and thus if a client
create a 16bpp drawable, and call get texture from pixmap then
a copy to here may occur and thus we have to force retur a TRUE
without do nothing.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
glamor/glamor_copyarea.c

index 6599d65..d19e28b 100644 (file)
@@ -395,6 +395,13 @@ _glamor_copy_n_to_n(DrawablePtr src,
            && glamor_ddx_fallback_check_pixmap(dst))
                goto done;
 
+       if (src_pixmap_priv->type == GLAMOR_DRM_ONLY
+           || dst_pixmap_priv->type == GLAMOR_DRM_ONLY) {
+               LogMessage(X_WARNING,
+                          "Access a DRM only pixmap is not allowed within glamor.\n",
+                          dst->pScreen->myNum);
+               return TRUE;
+       }
        glamor_report_delayed_fallbacks(src->pScreen);
        glamor_report_delayed_fallbacks(dst->pScreen);