xf86-video-ati: Branch 'cayman_accel' - 2 commits

Alex Deucher agd5f at kemper.freedesktop.org
Tue May 24 15:35:22 PDT 2011


 src/evergreen_accel.c |   30 ++++++++++++++++++++++++++++++
 src/evergreen_exa.c   |   42 +++++++++---------------------------------
 2 files changed, 39 insertions(+), 33 deletions(-)

New commits:
commit 470ecd02347c32e79316046d01a7d5dad0e2fe99
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Tue May 24 18:31:47 2011 -0400

    EXA/Xv: add workarounds for eg/cayman scissors bugs
    
    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>

diff --git a/src/evergreen_accel.c b/src/evergreen_accel.c
index 40aa372..5a0e357 100644
--- a/src/evergreen_accel.c
+++ b/src/evergreen_accel.c
@@ -704,12 +704,36 @@ evergreen_set_tex_sampler (ScrnInfoPtr pScrn, tex_sampler_t *s)
     END_BATCH();
 }
 
+/* workarounds for hw bugs in eg+ */
+/* only affects screen/window/generic/vport.  cliprects are not affected */
+void evergreen_fix_scissor_coordinates(ScrnInfoPtr pScrn, int *x1, int *y1, int *x2, int *y2)
+{
+    RADEONInfoPtr info = RADEONPTR(pScrn);
+
+    /* all eg+ asics */
+    if (*x2 == 0)
+	*x1 = 1;
+    if (*y2 == 0)
+	*y1 = 1;
+
+    /* cayman only */
+    if (info->ChipFamily == CHIP_FAMILY_CAYMAN) {
+	/* cliprects aren't affected so we can use them to clip if we need
+	 * a true 1x1 clip region
+	 */
+	if ((*x2 == 1) && (*y2 == 1))
+	    *x2 = 2;
+    }
+}
+
 //XXX deal with clip offsets in clip setup
 void
 evergreen_set_screen_scissor(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2)
 {
     RADEONInfoPtr info = RADEONPTR(pScrn);
 
+    evergreen_fix_scissor_coordinates(pScrn, &x1, &y1, &x2, &y2);
+
     BEGIN_BATCH(4);
     PACK0(PA_SC_SCREEN_SCISSOR_TL, 2);
     E32(((x1 << PA_SC_SCREEN_SCISSOR_TL__TL_X_shift) |
@@ -724,6 +748,8 @@ evergreen_set_vport_scissor(ScrnInfoPtr pScrn, int id, int x1, int y1, int x2, i
 {
     RADEONInfoPtr info = RADEONPTR(pScrn);
 
+    evergreen_fix_scissor_coordinates(pScrn, &x1, &y1, &x2, &y2);
+
     BEGIN_BATCH(4);
     PACK0(PA_SC_VPORT_SCISSOR_0_TL + id * PA_SC_VPORT_SCISSOR_0_TL_offset, 2);
     E32(((x1 << PA_SC_VPORT_SCISSOR_0_TL__TL_X_shift) |
@@ -739,6 +765,8 @@ evergreen_set_generic_scissor(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2)
 {
     RADEONInfoPtr info = RADEONPTR(pScrn);
 
+    evergreen_fix_scissor_coordinates(pScrn, &x1, &y1, &x2, &y2);
+
     BEGIN_BATCH(4);
     PACK0(PA_SC_GENERIC_SCISSOR_TL, 2);
     E32(((x1 << PA_SC_GENERIC_SCISSOR_TL__TL_X_shift) |
@@ -754,6 +782,8 @@ evergreen_set_window_scissor(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2)
 {
     RADEONInfoPtr info = RADEONPTR(pScrn);
 
+    evergreen_fix_scissor_coordinates(pScrn, &x1, &y1, &x2, &y2);
+
     BEGIN_BATCH(4);
     PACK0(PA_SC_WINDOW_SCISSOR_TL, 2);
     E32(((x1 << PA_SC_WINDOW_SCISSOR_TL__TL_X_shift) |
commit b913e7ba2b60d47a6660699210cc3cf6f5dc52c2
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Tue May 24 18:02:52 2011 -0400

    Revert "cayman: add scissors workaround."
    
    Needs a proper workaround for a hw bug.
    
    This reverts commit b77d374b0d11f48c33cfffdb4157c4ec4b05ea15.

diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 5752d0e..306e90f 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -58,24 +58,6 @@ extern int cayman_comp_ps(RADEONChipFamily ChipSet, uint32_t* ps);
 static void
 EVERGREENDoneSolid(PixmapPtr pPix);
 
-/* this is a workaround, but not sure for what -
- */
-static inline int cayman_adjust_scissor(ScrnInfoPtr pScrn, int height)
-{
-    RADEONInfoPtr info = RADEONPTR(pScrn);
-    if (info->ChipFamily != CHIP_FAMILY_CAYMAN)
-	return height;
-
-    if (height == 0)
-	return 0;
-
-    /* I've no idea if all scissors need to be even height or if its
-       just a 1 -> 2 problem */
-    if (height & 1)
-	height++;
-    return height;
-}
-
 static Bool
 EVERGREENPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
 {
@@ -88,7 +70,6 @@ EVERGREENPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
     float *ps_alu_consts;
     const_config_t ps_const_conf;
     struct r600_accel_object dst;
-    int scissor_height;
 
 
     if (!RADEONCheckBPP(pPix->drawable.bitsPerPixel))
@@ -125,10 +106,9 @@ EVERGREENPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg)
 
     evergreen_set_default_state(pScrn);
 
-    scissor_height = cayman_adjust_scissor(pScrn, accel_state->dst_obj.height);
-    evergreen_set_generic_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
-    evergreen_set_screen_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
-    evergreen_set_window_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
+    evergreen_set_generic_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
+    evergreen_set_screen_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
+    evergreen_set_window_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
 
     /* Shader */
     vs_conf.shader_addr         = accel_state->vs_mc_addr;
@@ -279,7 +259,6 @@ EVERGREENDoPrepareCopy(ScrnInfoPtr pScrn)
     tex_resource_t  tex_res;
     tex_sampler_t   tex_samp;
     shader_config_t vs_conf, ps_conf;
-    int scissor_height;
 
     CLEAR (cb_conf);
     CLEAR (tex_res);
@@ -292,10 +271,9 @@ EVERGREENDoPrepareCopy(ScrnInfoPtr pScrn)
 
     evergreen_set_default_state(pScrn);
 
-    scissor_height = cayman_adjust_scissor(pScrn, accel_state->dst_obj.height);
-    evergreen_set_generic_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
-    evergreen_set_screen_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
-    evergreen_set_window_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
+    evergreen_set_generic_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
+    evergreen_set_screen_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
+    evergreen_set_window_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
 
     /* Shader */
     vs_conf.shader_addr         = accel_state->vs_mc_addr;
@@ -1119,7 +1097,6 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     const_config_t vs_const_conf;
     struct r600_accel_object src_obj, mask_obj, dst_obj;
     float *cbuf;
-    int scissor_height;
 
     if (pDst->drawable.bitsPerPixel < 8 || pSrc->drawable.bitsPerPixel < 8)
 	return FALSE;
@@ -1207,10 +1184,9 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
 
     evergreen_set_default_state(pScrn);
 
-    scissor_height = cayman_adjust_scissor(pScrn, accel_state->dst_obj.height);
-    evergreen_set_generic_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
-    evergreen_set_screen_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
-    evergreen_set_window_scissor(pScrn, 0, 0, accel_state->dst_obj.width, scissor_height);
+    evergreen_set_generic_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
+    evergreen_set_screen_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
+    evergreen_set_window_scissor(pScrn, 0, 0, accel_state->dst_obj.width, accel_state->dst_obj.height);
 
     if (!EVERGREENTextureSetup(pSrcPicture, pSrc, 0)) {
         radeon_ib_discard(pScrn);


More information about the xorg-commit mailing list