Skip to contentSkip to conversation

radeon: Fix 1D tiling for CIK

PATCH In review Michel Dänzer 3 participants 6 messages Sep 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 radeon: Fix 1D tiling for CIK

From: Michel Dänzer <[email protected]>

The main difference is that the tiling mode index changed for 1D tiled depth/stencil surfaces.

---
 include/drm/radeon_drm.h | 15 +++++++++++++++
 radeon/radeon_surface.c  | 15 ++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
include/drm/radeon_drm.h +15 -0
index 86cef15..533c3dc 100644
@@ -1004,4 +1004,19 @@ struct drm_radeon_info {
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA	3
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA	2
 
+#define CIK_TILE_MODE_COLOR_LINEAR_ALIGNED	8
+#define CIK_TILE_MODE_COLOR_1D			13
+#define CIK_TILE_MODE_COLOR_1D_SCANOUT		9
+#define CIK_TILE_MODE_COLOR_2D_8BPP		14
+#define CIK_TILE_MODE_COLOR_2D_16BPP		15
+#define CIK_TILE_MODE_COLOR_2D_32BPP		16
+#define CIK_TILE_MODE_COLOR_2D_64BPP		17
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_16BPP	11
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_32BPP	12
+#define CIK_TILE_MODE_DEPTH_STENCIL_1D		5
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D		0
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_2AA	3
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_4AA	3
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_8AA	2
+
 #endif
radeon/radeon_surface.c +12 -3
index 818e26a..1710e34 100644
@@ -1382,10 +1382,16 @@ static int si_surface_sanity(struct radeon_surface_manager *surf_man,
         break;
     case RADEON_SURF_MODE_1D:
         if (surf->flags & RADEON_SURF_SBUFFER) {
-            *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *stencil_tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
         }
         if (surf->flags & RADEON_SURF_ZBUFFER) {
-            *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
         } else if (surf->flags & RADEON_SURF_SCANOUT) {
             *tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
         } else {
@@ -1643,7 +1649,10 @@ static int si_surface_init_2d(struct radeon_surface_manager *surf_man,
                 tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
                 break;
             case SI_TILE_MODE_DEPTH_STENCIL_2D:
-                tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+                if (surf_man->family >= CHIP_BONAIRE)
+                    tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+                else
+                    tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
                 break;
             default:
                 return -EINVAL;
Signature · 6 lines
1.8.4.rc3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

The main difference is that the tiling mode index changed for 1D tiled depth/stencil surfaces.

One comment below, other than that,

Quoted 18 lines
---
 include/drm/radeon_drm.h | 15 +++++++++++++++
 radeon/radeon_surface.c  | 15 ++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
include/drm/radeon_drm.h +5 -0
index 86cef15..533c3dc 100644
@@ -1004,4 +1004,19 @@ struct drm_radeon_info {
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA      3
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA      2
 
+#define CIK_TILE_MODE_COLOR_LINEAR_ALIGNED     8
+#define CIK_TILE_MODE_COLOR_1D                 13
+#define CIK_TILE_MODE_COLOR_1D_SCANOUT         9
+#define CIK_TILE_MODE_COLOR_2D_8BPP            14
+#define CIK_TILE_MODE_COLOR_2D_16BPP           15

include/drm/radeon_drm.h struct drm_radeon_info { · line 1021

Quoted 10 lines
include/drm/radeon_drm.h +10 -0
+#define CIK_TILE_MODE_COLOR_2D_32BPP           16
+#define CIK_TILE_MODE_COLOR_2D_64BPP           17
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_16BPP   11
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_32BPP   12
+#define CIK_TILE_MODE_DEPTH_STENCIL_1D         5
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D         0
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_2AA     3
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_4AA     3
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_8AA     2
+

Can you send a patch to add these to radeon_drm.h in the kernel as well?

Quoted 43 lines
include/drm/radeon_drm.h +0 -0
 #endif
radeon/radeon_surface.c +12 -4
index 818e26a..1710e34 100644
@@ -1382,10 +1382,16 @@ static int si_surface_sanity(struct radeon_surface_manager *surf_man,
         break;
     case RADEON_SURF_MODE_1D:
         if (surf->flags & RADEON_SURF_SBUFFER) {
-            *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *stencil_tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
         }
         if (surf->flags & RADEON_SURF_ZBUFFER) {
-            *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
         } else if (surf->flags & RADEON_SURF_SCANOUT) {
             *tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
         } else {
@@ -1643,7 +1649,10 @@ static int si_surface_init_2d(struct radeon_surface_manager *surf_man,
                 tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
                 break;
             case SI_TILE_MODE_DEPTH_STENCIL_2D:
-                tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+                if (surf_man->family >= CHIP_BONAIRE)
+                    tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+                else
+                    tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
                 break;
             default:
                 return -EINVAL;
--

1.8.4.rc3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Am 18.09.2013 17:54, schrieb Alex Deucher:

Quoted 24 lines · Michel Dänzer
Quoted 6 lines

From: Michel Dänzer <[email protected]>

The main difference is that the tiling mode index changed for 1D tiled depth/stencil surfaces.

One comment below, other than that,

Quoted 13 lines
---
  include/drm/radeon_drm.h | 15 +++++++++++++++
  radeon/radeon_surface.c  | 15 ++++++++++++---
  2 files changed, 27 insertions(+), 3 deletions(-)
include/drm/radeon_drm.h +0 -0
index 86cef15..533c3dc 100644
@@ -1004,4 +1004,19 @@ struct drm_radeon_info {
  #define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA      3
  #define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA      2
 
Quoted 11 lines

include/drm/radeon_drm.h struct drm_radeon_info { · line 1017

Quoted 11 lines
include/drm/radeon_drm.h +11 -0
+#define CIK_TILE_MODE_COLOR_LINEAR_ALIGNED     8
+#define CIK_TILE_MODE_COLOR_1D                 13
+#define CIK_TILE_MODE_COLOR_1D_SCANOUT         9
+#define CIK_TILE_MODE_COLOR_2D_8BPP            14
+#define CIK_TILE_MODE_COLOR_2D_16BPP           15
+#define CIK_TILE_MODE_COLOR_2D_32BPP           16
+#define CIK_TILE_MODE_COLOR_2D_64BPP           17
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_16BPP   11
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_32BPP   12
+#define CIK_TILE_MODE_DEPTH_STENCIL_1D         5
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D         0

And by the way, that looks a bit strange:

Quoted 2 lines

include/drm/radeon_drm.h struct drm_radeon_info { · line 1019

Quoted 2 lines
include/drm/radeon_drm.h +2 -0
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_2AA     3
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_4AA     3

Christian.

Quoted 51 lines

include/drm/radeon_drm.h struct drm_radeon_info { · line 1021

Quoted 2 lines
include/drm/radeon_drm.h +2 -0
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_8AA     2
+

Can you send a patch to add these to radeon_drm.h in the kernel as well?

Quoted 39 lines
include/drm/radeon_drm.h +0 -0
  #endif
radeon/radeon_surface.c +12 -4
index 818e26a..1710e34 100644
@@ -1382,10 +1382,16 @@ static int si_surface_sanity(struct radeon_surface_manager *surf_man,
          break;
      case RADEON_SURF_MODE_1D:
          if (surf->flags & RADEON_SURF_SBUFFER) {
-            *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *stencil_tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
          }
          if (surf->flags & RADEON_SURF_ZBUFFER) {
-            *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
          } else if (surf->flags & RADEON_SURF_SCANOUT) {
              *tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
          } else {
@@ -1643,7 +1649,10 @@ static int si_surface_init_2d(struct radeon_surface_manager *surf_man,
                  tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
                  break;
              case SI_TILE_MODE_DEPTH_STENCIL_2D:
-                tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+                if (surf_man->family >= CHIP_BONAIRE)
+                    tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+                else
+                    tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
                  break;
              default:
                  return -EINVAL;
--

1.8.4.rc3

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 42 lines · Christian König

Am 18.09.2013 17:54, schrieb Alex Deucher:

Quoted 26 lines · Michel Dänzer
Quoted 7 lines

From: Michel Dänzer <[email protected]>

The main difference is that the tiling mode index changed for 1D tiled depth/stencil surfaces.

One comment below, other than that,

Quoted 13 lines
---
  include/drm/radeon_drm.h | 15 +++++++++++++++
  radeon/radeon_surface.c  | 15 ++++++++++++---
  2 files changed, 27 insertions(+), 3 deletions(-)
include/drm/radeon_drm.h +0 -0
index 86cef15..533c3dc 100644
@@ -1004,4 +1004,19 @@ struct drm_radeon_info {
  #define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA      3
  #define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA      2
 
Quoted 11 lines

include/drm/radeon_drm.h struct drm_radeon_info { · line 1017

Quoted 11 lines
include/drm/radeon_drm.h +11 -0
+#define CIK_TILE_MODE_COLOR_LINEAR_ALIGNED     8
+#define CIK_TILE_MODE_COLOR_1D                 13
+#define CIK_TILE_MODE_COLOR_1D_SCANOUT         9
+#define CIK_TILE_MODE_COLOR_2D_8BPP            14
+#define CIK_TILE_MODE_COLOR_2D_16BPP           15
+#define CIK_TILE_MODE_COLOR_2D_32BPP           16
+#define CIK_TILE_MODE_COLOR_2D_64BPP           17
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_16BPP   11
+#define CIK_TILE_MODE_COLOR_2D_SCANOUT_32BPP   12
+#define CIK_TILE_MODE_DEPTH_STENCIL_1D         5
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D         0

And by the way, that looks a bit strange:

Quoted 3 lines
Quoted 2 lines

include/drm/radeon_drm.h struct drm_radeon_info { · line 1019

Quoted 2 lines
include/drm/radeon_drm.h +2 -0
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_2AA     3
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_4AA     3

It's correct according to the tiling documentation.

Alex

Quoted 62 lines

Christian.

Quoted 55 lines

include/drm/radeon_drm.h struct drm_radeon_info { · line 1021

Quoted 2 lines
include/drm/radeon_drm.h +2 -0
+#define CIK_TILE_MODE_DEPTH_STENCIL_2D_8AA     2
+

Can you send a patch to add these to radeon_drm.h in the kernel as well?

Quoted 38 lines
include/drm/radeon_drm.h +0 -0
  #endif
radeon/radeon_surface.c +8 -2
index 818e26a..1710e34 100644
@@ -1382,10 +1382,16 @@ static int si_surface_sanity(struct
 radeon_surface_manager *surf_man,
          break;
      case RADEON_SURF_MODE_1D:
          if (surf->flags & RADEON_SURF_SBUFFER) {
-            *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *stencil_tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *stencil_tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
          }
          if (surf->flags & RADEON_SURF_ZBUFFER) {
-            *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+            if (surf_man->family >= CHIP_BONAIRE)
+                *tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+            else
+                *tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
          } else if (surf->flags & RADEON_SURF_SCANOUT) {
              *tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
          } else {
radeon/radeon_surface.c +4 -1
@@ -1643,7 +1649,10 @@ static int si_surface_init_2d(struct
 radeon_surface_manager *surf_man,
                  tile_mode = SI_TILE_MODE_COLOR_1D_SCANOUT;
                  break;
              case SI_TILE_MODE_DEPTH_STENCIL_2D:
-                tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
+                if (surf_man->family >= CHIP_BONAIRE)
+                    tile_mode = CIK_TILE_MODE_DEPTH_STENCIL_1D;
+                else
+                    tile_mode = SI_TILE_MODE_DEPTH_STENCIL_1D;
                  break;
              default:
                  return -EINVAL;
Quoted 7 lines

--
1.8.4.rc3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

PATCH 1/1 drm/radeon/cik: Add tiling mode index for 1D tiled depth/stencil surfaces

In reply to Alex Deucher

From: Michel Dänzer <[email protected]>

---
 include/uapi/drm/radeon_drm.h | 2 ++
 1 file changed, 2 insertions(+)
include/uapi/drm/radeon_drm.h +2 -0
index fa8b3ad..46d41e8 100644
@@ -1007,4 +1007,6 @@ struct drm_radeon_info {
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA	3
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA	2
 
+#define CIK_TILE_MODE_DEPTH_STENCIL_1D		5
+
 #endif
Signature · 6 lines
1.8.4.rc3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#5 lore raw

Re: [PATCH] drm/radeon/cik: Add tiling mode index for 1D tiled depth/stencil surfaces

Quoted 3 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

Applied. thanks!

Alex

Quoted 22 lines
---
 include/uapi/drm/radeon_drm.h | 2 ++
 1 file changed, 2 insertions(+)
include/uapi/drm/radeon_drm.h +2 -1
index fa8b3ad..46d41e8 100644
@@ -1007,4 +1007,6 @@ struct drm_radeon_info {
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA      3
 #define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA      2
 
+#define CIK_TILE_MODE_DEPTH_STENCIL_1D         5
+
 #endif
--

1.8.4.rc3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel