summaryrefslogtreecommitdiff
path: root/vmwgfx/vmwgfx_saa.c
diff options
context:
space:
mode:
Diffstat (limited to 'vmwgfx/vmwgfx_saa.c')
-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.