From 4d8369f8e60fd4f5a0ef49f3e9866ea5ecb21927 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 8 Feb 2012 13:15:46 +0000 Subject: sna/gen2+: Force upload rather than perform source transformations on the CPU If both the source and destination is on the CPU, then the thinking was it would be quicker to operate on those on the CPU rather than copy both to the GPU and then perform the operation. This turns out to be a false assumption if transformation is involved -- something to be reconsidered if pixman should ever be improved. Signed-off-by: Chris Wilson --- src/sna/gen2_render.c | 8 +++++++- src/sna/gen3_render.c | 8 +++++++- src/sna/gen4_render.c | 8 +++++++- src/sna/gen5_render.c | 8 +++++++- src/sna/gen6_render.c | 8 +++++++- src/sna/gen7_render.c | 8 +++++++- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index ed48ce6d..64b4e7c1 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -1506,10 +1506,16 @@ has_alphamap(PicturePtr p) return p->alphaMap != NULL; } +static bool +untransformed(PicturePtr p) +{ + return !p->transform || pixman_transform_is_int_translate(p->transform); +} + static bool need_upload(PicturePtr p) { - return p->pDrawable && unattached(p->pDrawable); + return p->pDrawable && unattached(p->pDrawable) && untransformed(p); } static bool diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index fc006ac4..97e5839d 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -2418,10 +2418,16 @@ has_alphamap(PicturePtr p) return p->alphaMap != NULL; } +static bool +untransformed(PicturePtr p) +{ + return !p->transform || pixman_transform_is_int_translate(p->transform); +} + static bool need_upload(PicturePtr p) { - return p->pDrawable && unattached(p->pDrawable); + return p->pDrawable && unattached(p->pDrawable) && untransformed(p); } static bool diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index 62465383..6e7d4be6 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -2015,10 +2015,16 @@ has_alphamap(PicturePtr p) return p->alphaMap != NULL; } +static bool +untransformed(PicturePtr p) +{ + return !p->transform || pixman_transform_is_int_translate(p->transform); +} + static bool need_upload(PicturePtr p) { - return p->pDrawable && unattached(p->pDrawable); + return p->pDrawable && unattached(p->pDrawable) && untransformed(p); } static bool diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index b9c7a92a..7ac993cd 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -2043,10 +2043,16 @@ has_alphamap(PicturePtr p) return p->alphaMap != NULL; } +static bool +untransformed(PicturePtr p) +{ + return !p->transform || pixman_transform_is_int_translate(p->transform); +} + static bool need_upload(PicturePtr p) { - return p->pDrawable && unattached(p->pDrawable); + return p->pDrawable && unattached(p->pDrawable) && untransformed(p); } static bool diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 17789e96..1476ff7f 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -2324,10 +2324,16 @@ has_alphamap(PicturePtr p) return p->alphaMap != NULL; } +static bool +untransformed(PicturePtr p) +{ + return !p->transform || pixman_transform_is_int_translate(p->transform); +} + static bool need_upload(PicturePtr p) { - return p->pDrawable && unattached(p->pDrawable); + return p->pDrawable && unattached(p->pDrawable) && untransformed(p); } static bool diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 97574054..5740a421 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2328,10 +2328,16 @@ has_alphamap(PicturePtr p) return p->alphaMap != NULL; } +static bool +untransformed(PicturePtr p) +{ + return !p->transform || pixman_transform_is_int_translate(p->transform); +} + static bool need_upload(PicturePtr p) { - return p->pDrawable && unattached(p->pDrawable); + return p->pDrawable && unattached(p->pDrawable) && untransformed(p); } static bool -- cgit v1.2.3