drm/radeon/kms: add r1xx/r2xx support for CS_KEEP_TILING_FLAGS
Subsystems (2)
PATCH 1/2 drm/radeon/kms: add r1xx/r2xx support for CS_KEEP_TILING_FLAGS
From: Alex Deucher <[email protected]>
Previous patch only updates r3xx+. It's not likely anyone will use this on r1xx/r2xx, but add it for consistency.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/radeon/r100.c | 46 +++++++++++++++++++++++----------------- drivers/gpu/drm/radeon/r200.c | 17 +++++++++------ 2 files changed, 36 insertions(+), 27 deletions(-)
drivers/gpu/drm/radeon/r100.c +26 -20
@@ -87,23 +87,27 @@ int r100_reloc_pitch_offset(struct radeon_cs_parser *p,r100_cs_dump_packet (p, pkt);return r; } + value =radeon_get_ib_value (p, idx); tmp = value &0x003fffff ; tmp += (((u32 )reloc->lobj.gpu_offset) >>10 ); -if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) - tile_flags |=RADEON_DST_TILE_MACRO ; -if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) { -if (reg ==RADEON_SRC_PITCH_OFFSET ) { -DRM_ERROR ("Cannot src blit from microtiled surface\n" ); -r100_cs_dump_packet (p, pkt); -return -EINVAL ; +if (!(p->cs_flags &RADEON_CS_KEEP_TILING_FLAGS )) { +if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) + tile_flags |=RADEON_DST_TILE_MACRO ; +if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) { +if (reg ==RADEON_SRC_PITCH_OFFSET ) { +DRM_ERROR ("Cannot src blit from microtiled surface\n" ); +r100_cs_dump_packet (p, pkt); +return -EINVAL ; + } + tile_flags |=RADEON_DST_TILE_MICRO ; } - tile_flags |=RADEON_DST_TILE_MICRO ; - } - tmp |= tile_flags; - p->ib->ptr[idx] = (value &0x3fc00000 ) | tmp; + tmp |= tile_flags; + p->ib->ptr[idx] = (value &0x3fc00000 ) | tmp; + }else + p->ib->ptr[idx] = (value &0xffc00000 ) | tmp;return 0 ; }
@@ -1625,15 +1629,17 @@ static int r100_packet0_check(struct radeon_cs_parser *p,r100_cs_dump_packet (p, pkt);return r; } - -if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) - tile_flags |=RADEON_COLOR_TILE_ENABLE ; -if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) - tile_flags |=RADEON_COLOR_MICROTILE_ENABLE ; - - tmp = idx_value & ~(0x7 <<16 ); - tmp |= tile_flags; - ib[idx] = tmp; +if (!(p->cs_flags &RADEON_CS_KEEP_TILING_FLAGS )) { +if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) + tile_flags |=RADEON_COLOR_TILE_ENABLE ; +if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) + tile_flags |=RADEON_COLOR_MICROTILE_ENABLE ; + + tmp = idx_value & ~(0x7 <<16 ); + tmp |= tile_flags; + ib[idx] = tmp; + }else + ib[idx] = idx_value; track->cb[0 ].pitch = idx_value &RADEON_COLORPITCH_MASK ; track->cb_dirty = true;
drivers/gpu/drm/radeon/r200.c +10 -7
@@ -277,14 +277,17 @@ int r200_packet0_check(struct radeon_cs_parser *p,return r; } -if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) - tile_flags |=RADEON_COLOR_TILE_ENABLE ; -if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) - tile_flags |=RADEON_COLOR_MICROTILE_ENABLE ; +if (!(p->cs_flags &RADEON_CS_KEEP_TILING_FLAGS )) { +if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) + tile_flags |=RADEON_COLOR_TILE_ENABLE ; +if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) + tile_flags |=RADEON_COLOR_MICROTILE_ENABLE ; - tmp = idx_value & ~(0x7 <<16 ); - tmp |= tile_flags; - ib[idx] = tmp; + tmp = idx_value & ~(0x7 <<16 ); + tmp |= tile_flags; + ib[idx] = tmp; + }else + ib[idx] = idx_value; track->cb[0 ].pitch = idx_value &RADEON_COLORPITCH_MASK ; track->cb_dirty = true;
Signature · 1 line
1.7.7.5
PATCH 2/2 drm/radeon/kms: add r1xx/r2xx CS support for tiled textures
From: Alex Deucher <[email protected]>
Not likely this will be implemented anytime soon, but for completeness...
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/radeon/r100.c | 12 +++++++++++- drivers/gpu/drm/radeon/r200.c | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/r100.c +11 -1
@@ -1558,7 +1558,17 @@ static int r100_packet0_check(struct radeon_cs_parser *p,r100_cs_dump_packet (p, pkt);return r; } - ib[idx] = idx_value + ((u32 )reloc->lobj.gpu_offset); +if (!(p->cs_flags &RADEON_CS_KEEP_TILING_FLAGS )) { +if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) + tile_flags |=RADEON_TXO_MACRO_TILE ; +if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) + tile_flags |=RADEON_TXO_MICRO_TILE_X2 ; + + tmp = idx_value & ~(0x7 <<2 ); + tmp |= tile_flags; + ib[idx] = tmp + ((u32 )reloc->lobj.gpu_offset); + }else + ib[idx] = idx_value + ((u32 )reloc->lobj.gpu_offset); track->textures[i].robj = reloc->robj; track->tex_dirty = true;break ;
drivers/gpu/drm/radeon/r200.c +11 -1
@@ -215,7 +215,17 @@ int r200_packet0_check(struct radeon_cs_parser *p,r100_cs_dump_packet (p, pkt);return r; } - ib[idx] = idx_value + ((u32 )reloc->lobj.gpu_offset); +if (!(p->cs_flags &RADEON_CS_KEEP_TILING_FLAGS )) { +if (reloc->lobj.tiling_flags &RADEON_TILING_MACRO ) + tile_flags |=R200_TXO_MACRO_TILE ; +if (reloc->lobj.tiling_flags &RADEON_TILING_MICRO ) + tile_flags |=R200_TXO_MICRO_TILE ; + + tmp = idx_value & ~(0x7 <<2 ); + tmp |= tile_flags; + ib[idx] = tmp + ((u32 )reloc->lobj.gpu_offset); + }else + ib[idx] = idx_value + ((u32 )reloc->lobj.gpu_offset); track->textures[i].robj = reloc->robj; track->tex_dirty = true;break ;
Signature · 1 line
1.7.7.5