提交 43b93fbf 编写于 作者: A Alex Deucher 提交者: Dave Airlie

drm/radeon/kms: fix handling of tex lookup disable in cs checker on r2xx

There are cases when multiple texture units have to be enabled,
but not actually used to sample.  This patch checks to see if
the lookup_disable bit is set and if so, skips the texture check.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=25544Signed-off-by: NAlex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 135cba0d
...@@ -3180,6 +3180,8 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev, ...@@ -3180,6 +3180,8 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev,
for (u = 0; u < track->num_texture; u++) { for (u = 0; u < track->num_texture; u++) {
if (!track->textures[u].enabled) if (!track->textures[u].enabled)
continue; continue;
if (track->textures[u].lookup_disable)
continue;
robj = track->textures[u].robj; robj = track->textures[u].robj;
if (robj == NULL) { if (robj == NULL) {
DRM_ERROR("No texture bound to unit %u\n", u); DRM_ERROR("No texture bound to unit %u\n", u);
...@@ -3414,6 +3416,7 @@ void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track ...@@ -3414,6 +3416,7 @@ void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track
track->textures[i].robj = NULL; track->textures[i].robj = NULL;
/* CS IB emission code makes sure texture unit are disabled */ /* CS IB emission code makes sure texture unit are disabled */
track->textures[i].enabled = false; track->textures[i].enabled = false;
track->textures[i].lookup_disable = false;
track->textures[i].roundup_w = true; track->textures[i].roundup_w = true;
track->textures[i].roundup_h = true; track->textures[i].roundup_h = true;
if (track->separate_cube) if (track->separate_cube)
......
...@@ -46,6 +46,7 @@ struct r100_cs_track_texture { ...@@ -46,6 +46,7 @@ struct r100_cs_track_texture {
unsigned height_11; unsigned height_11;
bool use_pitch; bool use_pitch;
bool enabled; bool enabled;
bool lookup_disable;
bool roundup_w; bool roundup_w;
bool roundup_h; bool roundup_h;
unsigned compress_format; unsigned compress_format;
......
...@@ -447,6 +447,8 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -447,6 +447,8 @@ int r200_packet0_check(struct radeon_cs_parser *p,
track->textures[i].width = 1 << ((idx_value >> RADEON_TXFORMAT_WIDTH_SHIFT) & RADEON_TXFORMAT_WIDTH_MASK); track->textures[i].width = 1 << ((idx_value >> RADEON_TXFORMAT_WIDTH_SHIFT) & RADEON_TXFORMAT_WIDTH_MASK);
track->textures[i].height = 1 << ((idx_value >> RADEON_TXFORMAT_HEIGHT_SHIFT) & RADEON_TXFORMAT_HEIGHT_MASK); track->textures[i].height = 1 << ((idx_value >> RADEON_TXFORMAT_HEIGHT_SHIFT) & RADEON_TXFORMAT_HEIGHT_MASK);
} }
if (idx_value & R200_TXFORMAT_LOOKUP_DISABLE)
track->textures[i].lookup_disable = true;
switch ((idx_value & RADEON_TXFORMAT_FORMAT_MASK)) { switch ((idx_value & RADEON_TXFORMAT_FORMAT_MASK)) {
case R200_TXFORMAT_I8: case R200_TXFORMAT_I8:
case R200_TXFORMAT_RGB332: case R200_TXFORMAT_RGB332:
......
...@@ -2836,6 +2836,7 @@ ...@@ -2836,6 +2836,7 @@
# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) # define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24)
# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) # define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24)
# define R200_TXFORMAT_ST_ROUTE_SHIFT 24 # define R200_TXFORMAT_ST_ROUTE_SHIFT 24
# define R200_TXFORMAT_LOOKUP_DISABLE (1 << 27)
# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) # define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) # define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) # define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册