summaryrefslogtreecommitdiff
path: root/src/i830_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-10 09:39:44 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-05-17 20:16:24 +0100
commit8d5e51eeec1f666d585bf5871f05ec038b7f1b7d (patch)
tree8ee3c57a55f3a476f2b84171cb17e86163dd7c82 /src/i830_render.c
parentd9f742ce0e4ba1a884749f373dc43f350dd2a05a (diff)
uxa: Rearrange checking and preparing of composite textures.
x11perf regression caused by 2D driver https://bugs.freedesktop.org/show_bug.cgi?id=28047 caused by commit a7b800513fcc94e063dfd68d2f63b6bab7fae47d uxa: Extract sub-region from in-memory buffers. The issue is that as we extract the region prior to checking whether the composite can in fact be accelerated, we perform expensive surplus operations. This is particularly noticeable for ComponentAlpha text, such as rgb10text. The solution here is to rearrange the check_composite() prior to acquiring the sources, and only extracting the subregion if the render path can not actually handle the texture. Performance (on PineView): a7b800513^: aa=68600 glyphs/s, rgb=29900 glyphs/s a7b800513: aa=65700 glyphs/s, rgb=13200 glyphs/s now: aa=66800 glyph/s, rgb=28800 glyphs/s The residual lossage seems to be from the extra function call and dixPrivate lookups. Hmm. More warning is the extremely low performance, however the results are consistent so the improvement looks real... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit f52b6e832292c02c0010b19882e38e1097beeda0) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'src/i830_render.c')
-rw-r--r--src/i830_render.c104
1 files changed, 50 insertions, 54 deletions
diff --git a/src/i830_render.c b/src/i830_render.c
index da075d93..16ba3115 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -221,52 +221,6 @@ static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr mask,
return TRUE;
}
-static Bool i830_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
- int unit)
-{
- if (picture->repeatType > RepeatReflect) {
- intel_debug_fallback(scrn, "Unsupported picture repeat %d\n",
- picture->repeatType);
- return FALSE;
- }
-
- if (picture->filter != PictFilterNearest &&
- picture->filter != PictFilterBilinear) {
- intel_debug_fallback(scrn, "Unsupported filter 0x%x\n",
- picture->filter);
- return FALSE;
- }
-
- if (picture->pDrawable) {
- int w, h, i;
-
- w = picture->pDrawable->width;
- h = picture->pDrawable->height;
- if ((w > 2048) || (h > 2048)) {
- intel_debug_fallback(scrn,
- "Picture w/h too large (%dx%d)\n",
- w, h);
- return FALSE;
- }
-
- for (i = 0;
- i < sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]);
- i++) {
- if (i830_tex_formats[i].fmt == picture->format)
- break;
- }
- if (i == sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]))
- {
- intel_debug_fallback(scrn, "Unsupported picture format "
- "0x%x\n",
- (int)picture->format);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
static uint32_t i8xx_get_card_format(PicturePtr picture)
{
int i;
@@ -414,22 +368,64 @@ i830_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
}
}
- if (!i830_check_composite_texture(scrn, source_picture, 0)) {
- intel_debug_fallback(scrn, "Check Src picture texture\n");
+ if (!i830_get_dest_format(dest_picture, &tmp1)) {
+ intel_debug_fallback(scrn, "Get Color buffer format\n");
return FALSE;
}
- if (mask_picture != NULL
- && !i830_check_composite_texture(scrn, mask_picture, 1)) {
- intel_debug_fallback(scrn, "Check Mask picture texture\n");
+
+ return TRUE;
+}
+
+Bool
+i830_check_composite_texture(ScreenPtr screen, PicturePtr picture)
+{
+ if (picture->repeatType > RepeatReflect) {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_debug_fallback(scrn, "Unsupported picture repeat %d\n",
+ picture->repeatType);
return FALSE;
}
- if (!i830_get_dest_format(dest_picture, &tmp1)) {
- intel_debug_fallback(scrn, "Get Color buffer format\n");
+ if (picture->filter != PictFilterNearest &&
+ picture->filter != PictFilterBilinear) {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_debug_fallback(scrn, "Unsupported filter 0x%x\n",
+ picture->filter);
return FALSE;
}
- return TRUE;
+ if (picture->pDrawable) {
+ int w, h, i;
+
+ w = picture->pDrawable->width;
+ h = picture->pDrawable->height;
+ if ((w > 2048) || (h > 2048)) {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_debug_fallback(scrn,
+ "Picture w/h too large (%dx%d)\n",
+ w, h);
+ return FALSE;
+ }
+
+ for (i = 0;
+ i < sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]);
+ i++) {
+ if (i830_tex_formats[i].fmt == picture->format)
+ break;
+ }
+ if (i == sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]))
+ {
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_debug_fallback(scrn, "Unsupported picture format "
+ "0x%x\n",
+ (int)picture->format);
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
}
Bool