diff options
author | Dave Airlie <airlied@redhat.com> | 2011-05-24 15:53:58 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-05-24 15:55:58 +1000 |
commit | b77d374b0d11f48c33cfffdb4157c4ec4b05ea15 (patch) | |
tree | 4da9ebad424c30b85d96ef84b324051efe1e134f | |
parent | ffeab7a7058298e15294a3b2c740c731e36dda1d (diff) |
cayman: add scissors workaround.
wasted a lot of time getting to this.
-rw-r--r-- | src/evergreen_exa.c | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c index 58f3bf1c..9a166b07 100644 --- a/src/evergreen_exa.c +++ b/src/evergreen_exa.c @@ -58,6 +58,24 @@ 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) { @@ -70,6 +88,7 @@ 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 (info->ChipFamily == CHIP_FAMILY_CAYMAN) return FALSE; @@ -108,9 +127,10 @@ EVERGREENPrepareSolid(PixmapPtr pPix, int alu, Pixel pm, Pixel fg) evergreen_set_default_state(pScrn); - 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); + 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); /* Shader */ vs_conf.shader_addr = accel_state->vs_mc_addr; @@ -261,6 +281,7 @@ 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); @@ -273,9 +294,10 @@ EVERGREENDoPrepareCopy(ScrnInfoPtr pScrn) evergreen_set_default_state(pScrn); - 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); + 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); /* Shader */ vs_conf.shader_addr = accel_state->vs_mc_addr; @@ -1102,6 +1124,7 @@ 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 (info->ChipFamily == CHIP_FAMILY_CAYMAN) return FALSE; @@ -1192,9 +1215,10 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture, evergreen_set_default_state(pScrn); - 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); + 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); if (!EVERGREENTextureSetup(pSrcPicture, pSrc, 0)) { radeon_ib_discard(pScrn); |