summaryrefslogtreecommitdiff
path: root/vmwgfx
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-12-14 12:38:27 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2011-12-15 08:32:14 +0100
commit5748c33535bc7d3009b9758653885e6ae0e73002 (patch)
tree311799a48c3d1f7c55f79aa8f8f4fa3fe758fba2 /vmwgfx
parentf664e31d73bd31594e069d8bcca872687b84d8d9 (diff)
saa, vmwgfx: Fix saa_copy_composite
The traditional accelerated copy methods aren't format aware. Make saa copy format aware,and pass formats on to the driver copy function if available. If the driver can't handle format conversions it needs to return FALSE. This fixes format confusion in the copy composite fastpath. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'vmwgfx')
-rw-r--r--vmwgfx/vmwgfx_saa.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
index 7788ed5..0a6b98f 100644
--- a/vmwgfx/vmwgfx_saa.c
+++ b/vmwgfx/vmwgfx_saa.c
@@ -896,10 +896,23 @@ vmwgfx_copy_prepare(struct saa_driver *driver,
* Determine surface formats.
*/
- if (!vmwgfx_hw_accel_stage(src_pixmap, 0, XA_FLAG_RENDER_TARGET, 0))
- return FALSE;
- if (!vmwgfx_hw_accel_stage(dst_pixmap, 0, XA_FLAG_RENDER_TARGET, 0))
- return FALSE;
+ if (src_vpix->base.src_format == 0) {
+ if (!vmwgfx_hw_accel_stage(src_pixmap, 0, XA_FLAG_RENDER_TARGET, 0))
+ return FALSE;
+ } else {
+ if (PICT_FORMAT_TYPE(src_vpix->base.src_format) != PICT_TYPE_ARGB ||
+ !vmwgfx_hw_composite_src_stage(src_pixmap, src_vpix->base.src_format))
+ return FALSE;
+ }
+
+ if (dst_vpix->base.dst_format == 0) {
+ if (!vmwgfx_hw_accel_stage(dst_pixmap, 0, XA_FLAG_RENDER_TARGET, 0))
+ return FALSE;
+ } else {
+ if (PICT_FORMAT_TYPE(dst_vpix->base.dst_format) != PICT_TYPE_ARGB ||
+ !vmwgfx_hw_composite_dst_stage(dst_pixmap, dst_vpix->base.dst_format))
+ return FALSE;
+ }
/*
* Create hardware surfaces.