Skip to contentSkip to conversation

Enable MSAA registers for r300-r500 chipsets

RFC PATCH In review Corbin Simpson 3 participants 3 messages Jan 17, 2010 – Jan 18, 2010 2 messages not in the archive

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

RFC PATCH 1/1 Enable MSAA registers for r300-r500 chipsets

Two patches attached, one for the kernel and one for the DDX.

Comments welcome; I have no idea exactly how to handle the case where the DDX is newer than the kernel. Do we need to make a patchlevel version bump and check?

~ C.

--
Corbin Simpson
<[email protected]>

From b2d2461ef4ce039815b8e3a53f1119a059bf86a3 Mon Sep 17 00:00:00 2001
From: Corbin Simpson <[email protected]>
Date: Sun, 17 Jan 2010 12:13:54 -0800
Subject: [PATCH] drivers/gpu/drm/radeon: Permit userspace to write MSAA registers.

This was omitted before to keep legacy DDX from misrendering, but it's probably a good idea to fix this before leaving staging.

---
 drivers/gpu/drm/radeon/reg_srcs/r300  |    2 ++
 drivers/gpu/drm/radeon/reg_srcs/r420  |    2 ++
 drivers/gpu/drm/radeon/reg_srcs/rs600 |    2 ++
 drivers/gpu/drm/radeon/reg_srcs/rv515 |    2 ++
 4 files changed, 8 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/reg_srcs/r300 +2 -0
index 19c4663..1e97b2d 100644
@@ -125,6 +125,8 @@ r300 0x4f60
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
drivers/gpu/drm/radeon/reg_srcs/r420 +2 -0
index 989f7a0..e958980 100644
@@ -125,6 +125,8 @@ r420 0x4f60
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
drivers/gpu/drm/radeon/reg_srcs/rs600 +2 -0
index 6801b86..83e8bc0 100644
@@ -125,6 +125,8 @@ rs600 0x6d40
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
drivers/gpu/drm/radeon/reg_srcs/rv515 +2 -0
index 38abf63..7f44ada 100644
@@ -158,6 +158,8 @@ rv515 0x6d40
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
Signature · 1 line
1.6.5.2

From 7b2d09d148582dd92dca6044b3a3fab90a476f88 Mon Sep 17 00:00:00 2001
From: Corbin Simpson <[email protected]>
Date: Sun, 17 Jan 2010 12:23:28 -0800
Subject: [PATCH] Always write MSAA control registers.

Prevents misrendering if a 3D driver has used them.

---
 src/radeon_commonfuncs.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)
src/radeon_commonfuncs.c +17 -17
index 8c46235..3d04f27 100644
@@ -110,29 +110,29 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn)
 	OUT_ACCEL_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN);
 	FINISH_ACCEL();
 
-	BEGIN_ACCEL(3);
+	BEGIN_ACCEL(5);
 	OUT_ACCEL_REG(R300_GB_AA_CONFIG, 0);
+    OUT_ACCEL_REG(R300_GB_MSPOS0, ((6 << R300_MS_X0_SHIFT) |
+                   (6 << R300_MS_Y0_SHIFT) |
+                   (6 << R300_MS_X1_SHIFT) |
+                   (6 << R300_MS_Y1_SHIFT) |
+                   (6 << R300_MS_X2_SHIFT) |
+                   (6 << R300_MS_Y2_SHIFT) |
+                   (6 << R300_MSBD0_Y_SHIFT) |
+                   (6 << R300_MSBD0_X_SHIFT)));
+    OUT_ACCEL_REG(R300_GB_MSPOS1, ((6 << R300_MS_X3_SHIFT) |
+                   (6 << R300_MS_Y3_SHIFT) |
+                   (6 << R300_MS_X4_SHIFT) |
+                   (6 << R300_MS_Y4_SHIFT) |
+                   (6 << R300_MS_X5_SHIFT) |
+                   (6 << R300_MS_Y5_SHIFT) |
+                   (6 << R300_MSBD1_SHIFT)));
 	OUT_ACCEL_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_DC_FLUSH_3D | R300_DC_FREE_3D);
 	OUT_ACCEL_REG(R300_RB3D_ZCACHE_CTLSTAT, R300_ZC_FLUSH | R300_ZC_FREE);
 	FINISH_ACCEL();
 
 	if (!info->cs) {
-	    BEGIN_ACCEL(3);
-	    OUT_ACCEL_REG(R300_GB_MSPOS0, ((6 << R300_MS_X0_SHIFT) |
-					   (6 << R300_MS_Y0_SHIFT) |
-					   (6 << R300_MS_X1_SHIFT) |
-					   (6 << R300_MS_Y1_SHIFT) |
-					   (6 << R300_MS_X2_SHIFT) |
-					   (6 << R300_MS_Y2_SHIFT) |
-					   (6 << R300_MSBD0_Y_SHIFT) |
-					   (6 << R300_MSBD0_X_SHIFT)));
-	    OUT_ACCEL_REG(R300_GB_MSPOS1, ((6 << R300_MS_X3_SHIFT) |
-					   (6 << R300_MS_Y3_SHIFT) |
-					   (6 << R300_MS_X4_SHIFT) |
-					   (6 << R300_MS_Y4_SHIFT) |
-					   (6 << R300_MS_X5_SHIFT) |
-					   (6 << R300_MS_Y5_SHIFT) |
-					   (6 << R300_MSBD1_SHIFT)));
+        BEGIN_ACCEL(1);
 	    OUT_ACCEL_REG(R300_GA_ENHANCE, R300_GA_DEADLOCK_CNTL | R300_GA_FASTSYNC_CNTL);
 	    FINISH_ACCEL();
 	}
Signature · 1 line
1.6.5.2

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev

--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): e7bd23c31001171228m23bb4d3cje5dc9aaed41a5244-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#2 lore raw
Quoted 6 lines · Corbin Simpson

Two patches attached, one for the kernel and one for the DDX.

Comments welcome; I have no idea exactly how to handle the case where the DDX is newer than the kernel. Do we need to make a patchlevel version bump and check?

If ddx is newer than the kernel than we should not write the mpos reg. I think the issue is more about how mesa knows that ddx is recent enought. Mesa driver need to check before enabling those that ddx will restore its mspos settings. Others solution is to always restore for the ddx the mspos settings (mesa stills need to check for kernel support).

Cheers,
Jerome

A message that is not in the archive (sent off-list or not yet received): 20100117204749.GA19195-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#4 lore raw

Version two of these patches. The kernel patchlevel is bumped. DDX now checks kernel version before writing MSPOS, and I've got some Gallium code to do the same, not yet pushed.

~ C.

Quoted 17 lines · Jerome Glisse
Quoted 6 lines · Corbin Simpson

Two patches attached, one for the kernel and one for the DDX.

Comments welcome; I have no idea exactly how to handle the case where the DDX is newer than the kernel. Do we need to make a patchlevel version bump and check?

If ddx is newer than the kernel than we should not write the mpos reg. I think the issue is more about how mesa knows that ddx is recent enought. Mesa driver need to check before enabling those that ddx will restore its mspos settings. Others solution is to always restore for the ddx the mspos settings (mesa stills need to check for kernel support).

Cheers,
Jerome

Signature · 5 lines
Only fools are easily impressed by what is only
barely beyond their reach. ~ Unknown

Corbin Simpson
<[email protected]>

From 347c760c89bd702fa204244c9e4d6012a12bb627 Mon Sep 17 00:00:00 2001
From: Corbin Simpson <[email protected]>
Date: Sun, 17 Jan 2010 12:13:54 -0800
Subject: [PATCH] drivers/gpu/drm/radeon: Permit userspace to write MSAA registers.

Bump patchlevel version so userspace can tell when it's safe.

---
 drivers/gpu/drm/radeon/radeon_drv.c   |    2 +-
 drivers/gpu/drm/radeon/reg_srcs/r300  |    2 ++
 drivers/gpu/drm/radeon/reg_srcs/r420  |    2 ++
 drivers/gpu/drm/radeon/reg_srcs/rs600 |    2 ++
 drivers/gpu/drm/radeon/reg_srcs/rv515 |    2 ++
 5 files changed, 9 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +1 -1
index 8ba3de7..e64d931 100644
@@ -43,7 +43,7 @@
  */
 #define KMS_DRIVER_MAJOR	2
 #define KMS_DRIVER_MINOR	0
-#define KMS_DRIVER_PATCHLEVEL	0
+#define KMS_DRIVER_PATCHLEVEL	1
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
 int radeon_driver_firstopen_kms(struct drm_device *dev);
drivers/gpu/drm/radeon/reg_srcs/r300 +2 -0
index 19c4663..1e97b2d 100644
@@ -125,6 +125,8 @@ r300 0x4f60
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
drivers/gpu/drm/radeon/reg_srcs/r420 +2 -0
index 989f7a0..e958980 100644
@@ -125,6 +125,8 @@ r420 0x4f60
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
drivers/gpu/drm/radeon/reg_srcs/rs600 +2 -0
index 6801b86..83e8bc0 100644
@@ -125,6 +125,8 @@ rs600 0x6d40
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
drivers/gpu/drm/radeon/reg_srcs/rv515 +2 -0
index 38abf63..7f44ada 100644
@@ -158,6 +158,8 @@ rv515 0x6d40
 0x4000 GB_VAP_RASTER_VTX_FMT_0
 0x4004 GB_VAP_RASTER_VTX_FMT_1
 0x4008 GB_ENABLE
+0x4010 GB_MSPOS0
+0x4014 GB_MSPOS1
 0x401C GB_SELECT
 0x4020 GB_AA_CONFIG
 0x4024 GB_FIFO_SIZE
Signature · 1 line
1.6.5.2

From 80397e84fbf5b83a6906468484e9993c554a353a Mon Sep 17 00:00:00 2001
From: Corbin Simpson <[email protected]>
Date: Sun, 17 Jan 2010 17:48:16 -0800
Subject: [PATCH] Re-write MSAA registers, if available.

---
 src/radeon_commonfuncs.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
src/radeon_commonfuncs.c +9 -2
index 8c46235..c9aefa3 100644
@@ -116,8 +116,10 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn)
 	OUT_ACCEL_REG(R300_RB3D_ZCACHE_CTLSTAT, R300_ZC_FLUSH | R300_ZC_FREE);
 	FINISH_ACCEL();
 
-	if (!info->cs) {
-	    BEGIN_ACCEL(3);
+	if (!info->cs ||
+        info->dri->pKernelDRMVersion->version_minor >= 1 ||
+        info->dri->pKernelDRMVersion->version_patchlevel >= 1) {
+	    BEGIN_ACCEL(2);
 	    OUT_ACCEL_REG(R300_GB_MSPOS0, ((6 << R300_MS_X0_SHIFT) |
 					   (6 << R300_MS_Y0_SHIFT) |
 					   (6 << R300_MS_X1_SHIFT) |
@@ -133,6 +135,11 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn)
 					   (6 << R300_MS_X5_SHIFT) |
 					   (6 << R300_MS_Y5_SHIFT) |
 					   (6 << R300_MSBD1_SHIFT)));
+	    FINISH_ACCEL();
+	}
+
+	if (!info->cs) {
+	    BEGIN_ACCEL(1);
 	    OUT_ACCEL_REG(R300_GA_ENHANCE, R300_GA_DEADLOCK_CNTL | R300_GA_FASTSYNC_CNTL);
 	    FINISH_ACCEL();
 	}
Signature · 1 line
1.6.5.2

_______________________________________________
xorg-driver-ati mailing list [email protected]
http://lists.x.org/mailman/listinfo/xorg-driver-ati