diff options
author | Zhigang Gong <zhigang.gong@linux.intel.com> | 2012-02-17 19:50:52 +0800 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-02-21 08:42:54 +0000 |
commit | d98b41ce4323b43d2359349a04a4a56559e341a2 (patch) | |
tree | 3287daa6265570232ac0cf30a407203cadb0179b | |
parent | 1e0d702c3a77f6db3dfd55b8cafc5fca4d778751 (diff) |
uxa/glamor/dri: Should fixup the drawable pixmap.
Two fixes in this commit, first we only need to check the
front left buffer, for other attachment we don't need to
check them. The second is, we should fixup the pixmap's
drawable not the original drawable.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel_dri.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/intel_dri.c b/src/intel_dri.c index 2a0102d0..f6f0c863 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -280,14 +280,18 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments, pixmap = NULL; if (attachments[i] == DRI2BufferFrontLeft) { pixmap = get_front_buffer(drawable); + + if (pixmap && intel_get_pixmap_private(pixmap) == NULL) { + is_glamor_pixmap = TRUE; + drawable = &pixmap->drawable; + pixmap = NULL; + } } else if (attachments[i] == DRI2BufferStencil && pDepthPixmap) { pixmap = pDepthPixmap; pixmap->refcnt++; } - is_glamor_pixmap = pixmap && (intel_get_pixmap_private(pixmap) == NULL); - - if (pixmap == NULL || is_glamor_pixmap) { + if (pixmap == NULL) { unsigned int hint = INTEL_CREATE_PIXMAP_DRI2; if (intel->tiling & INTEL_TILING_3D) { @@ -398,11 +402,17 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, } pixmap = NULL; - if (attachment == DRI2BufferFrontLeft) + if (attachment == DRI2BufferFrontLeft) { pixmap = get_front_buffer(drawable); - is_glamor_pixmap = pixmap && (intel_get_pixmap_private(pixmap) == NULL); - if (pixmap == NULL || is_glamor_pixmap) { + if (pixmap && intel_get_pixmap_private(pixmap) == NULL) { + is_glamor_pixmap = TRUE; + drawable = &pixmap->drawable; + pixmap = NULL; + } + } + + if (pixmap == NULL) { unsigned int hint = INTEL_CREATE_PIXMAP_DRI2; int pixmap_width = drawable->width; int pixmap_height = drawable->height; |