drm/radeon/kms: add r1xx/r2xx CS support for tiled textures
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 2 Feb 2012 15:11:12 +0000 (10:11 -0500)
committerDave Airlie <airlied@redhat.com>
Fri, 3 Feb 2012 09:41:35 +0000 (09:41 +0000)
Not likely this will be implemented anytime soon, but for
completeness...

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r200.c

index 7dd6a1c473453b9ad4b2aca5f4ba4e53c3ed7668..99bb006493570ae6da356193684fffeeb7712afa 100644 (file)
@@ -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;
index 2f44397f6df7fe3a91005ea75a765e663cb54a17..a59cc474d53725978deaaa221892104bc876f27e 100644 (file)
@@ -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;
This page took 0.027494 seconds and 5 git commands to generate.