summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-11-05 11:28:06 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-11-05 11:28:06 +0000
commite309cea3ae5c22c58a918008a52e3d8d694c9ff2 (patch)
tree7e487aa22f80d0bdfe1d49cb9d60636536c6eee5 /src
parentab3d6d878fa27515eb760107d963d522cc87cd77 (diff)
sna: Do the supported PictOp check first
There is no point even attempting a BLT operation if we know that it is an unusual render operation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/gen2_render.c24
-rw-r--r--src/sna/gen3_render.c24
-rw-r--r--src/sna/gen4_render.c6
-rw-r--r--src/sna/gen5_render.c10
-rw-r--r--src/sna/gen6_render.c5
-rw-r--r--src/sna/gen7_render.c5
6 files changed, 36 insertions, 38 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 8908ae2a..8e099155 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1251,6 +1251,12 @@ gen2_render_composite(struct sna *sna,
{
DBG(("%s()\n", __FUNCTION__));
+ if (op >= ARRAY_SIZE(gen2_blend_op)) {
+ DBG(("%s: fallback due to unhandled blend op: %d\n",
+ __FUNCTION__, op));
+ return FALSE;
+ }
+
/* Try to use the BLT engine unless it implies a
* 3D -> 2D context switch.
*/
@@ -1264,12 +1270,6 @@ gen2_render_composite(struct sna *sna,
tmp))
return TRUE;
- if (op >= ARRAY_SIZE(gen2_blend_op)) {
- DBG(("%s: fallback due to unhandled blend op: %d\n",
- __FUNCTION__, op));
- return FALSE;
- }
-
if (!gen2_check_dst_format(dst->format)) {
DBG(("%s: fallback due to unhandled dst format: %x\n",
__FUNCTION__, dst->format));
@@ -1906,6 +1906,12 @@ gen2_render_fill_boxes(struct sna *sna,
struct sna_composite_op tmp;
uint32_t pixel;
+ if (op >= ARRAY_SIZE(gen2_blend_op)) {
+ DBG(("%s: fallback due to unhandled blend op: %d\n",
+ __FUNCTION__, op));
+ return FALSE;
+ }
+
#if NO_FILL_BOXES
return gen2_render_fill_boxes_try_blt(sna, op, format, color,
dst, dst_bo,
@@ -1916,12 +1922,6 @@ gen2_render_fill_boxes(struct sna *sna,
__FUNCTION__, op, (int)format,
color->red, color->green, color->blue, color->alpha));
- if (op >= ARRAY_SIZE(gen2_blend_op)) {
- DBG(("%s: fallback due to unhandled blend op: %d\n",
- __FUNCTION__, op));
- return FALSE;
- }
-
if (dst->drawable.width > 2048 ||
dst->drawable.height > 2048 ||
dst_bo->pitch > 8192 ||
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 01007e93..54396728 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -2254,6 +2254,12 @@ gen3_render_composite(struct sna *sna,
{
DBG(("%s()\n", __FUNCTION__));
+ if (op >= ARRAY_SIZE(gen3_blend_op)) {
+ DBG(("%s: fallback due to unhandled blend op: %d\n",
+ __FUNCTION__, op));
+ return FALSE;
+ }
+
#if NO_COMPOSITE
if (mask)
return FALSE;
@@ -2278,12 +2284,6 @@ gen3_render_composite(struct sna *sna,
tmp))
return TRUE;
- if (op >= ARRAY_SIZE(gen3_blend_op)) {
- DBG(("%s: fallback due to unhandled blend op: %d\n",
- __FUNCTION__, op));
- return FALSE;
- }
-
if (!gen3_check_dst_format(dst->format)) {
DBG(("%s: fallback due to unhandled dst format: %x\n",
__FUNCTION__, dst->format));
@@ -3690,6 +3690,12 @@ gen3_render_fill_boxes(struct sna *sna,
struct sna_composite_op tmp;
uint32_t pixel;
+ if (op >= ARRAY_SIZE(gen3_blend_op)) {
+ DBG(("%s: fallback due to unhandled blend op: %d\n",
+ __FUNCTION__, op));
+ return FALSE;
+ }
+
#if NO_FILL_BOXES
return gen3_render_fill_boxes_try_blt(sna, op, format, color,
dst, dst_bo,
@@ -3700,12 +3706,6 @@ gen3_render_fill_boxes(struct sna *sna,
__FUNCTION__, op, (int)format,
color->red, color->green, color->blue, color->alpha));
- if (op >= ARRAY_SIZE(gen3_blend_op)) {
- DBG(("%s: fallback due to unhandled blend op: %d\n",
- __FUNCTION__, op));
- return FALSE;
- }
-
if (dst->drawable.width > 2048 ||
dst->drawable.height > 2048 ||
dst_bo->pitch > 8192 ||
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 3c269945..e3a715ed 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1899,6 +1899,9 @@ gen4_render_composite(struct sna *sna,
DBG(("%s: %dx%d, current mode=%d\n", __FUNCTION__,
width, height, sna->kgem.mode));
+ if (op >= ARRAY_SIZE(gen4_blend_op))
+ return FALSE;
+
#if NO_COMPOSITE
if (mask)
return FALSE;
@@ -1919,9 +1922,6 @@ gen4_render_composite(struct sna *sna,
width, height, tmp))
return TRUE;
- if (op >= ARRAY_SIZE(gen4_blend_op))
- return FALSE;
-
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
src_x, src_y,
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 28c7a073..82a84d6a 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -1936,6 +1936,11 @@ gen5_render_composite(struct sna *sna,
DBG(("%s: %dx%d, current mode=%d\n", __FUNCTION__,
width, height, sna->kgem.mode));
+ if (op >= ARRAY_SIZE(gen5_blend_op)) {
+ DBG(("%s: unhandled blend op %d\n", __FUNCTION__, op));
+ return FALSE;
+ }
+
if (mask == NULL &&
try_blt(sna, src, width, height) &&
sna_blt_composite(sna, op,
@@ -1945,11 +1950,6 @@ gen5_render_composite(struct sna *sna,
width, height, tmp))
return TRUE;
- if (op >= ARRAY_SIZE(gen5_blend_op)) {
- DBG(("%s: unhandled blend op %d\n", __FUNCTION__, op));
- return FALSE;
- }
-
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
src_x, src_y,
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 7cb8e71f..9e184452 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2092,6 +2092,8 @@ gen6_render_composite(struct sna *sna,
int16_t width, int16_t height,
struct sna_composite_op *tmp)
{
+ if (op >= ARRAY_SIZE(gen6_blend_op))
+ return FALSE;
#if NO_COMPOSITE
if (mask)
@@ -2116,9 +2118,6 @@ gen6_render_composite(struct sna *sna,
width, height, tmp))
return TRUE;
- if (op >= ARRAY_SIZE(gen6_blend_op))
- return FALSE;
-
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
src_x, src_y,
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index ba6e9d54..79477498 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2228,6 +2228,8 @@ gen7_render_composite(struct sna *sna,
int16_t width, int16_t height,
struct sna_composite_op *tmp)
{
+ if (op >= ARRAY_SIZE(gen7_blend_op))
+ return FALSE;
#if NO_COMPOSITE
if (mask)
@@ -2252,9 +2254,6 @@ gen7_render_composite(struct sna *sna,
width, height, tmp))
return TRUE;
- if (op >= ARRAY_SIZE(gen7_blend_op))
- return FALSE;
-
if (need_tiling(sna, width, height))
return sna_tiling_composite(op, src, mask, dst,
src_x, src_y,