[PATCH] drm/radeon/kms: add accel parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 114f3491a411f50a0de1d59475fc267efd5afa6a Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@xxxxxxxxx>
Date: Fri, 23 Apr 2010 17:12:46 -0400
Subject: [PATCH] drm/radeon/kms: add accel parameter

passing accel=0 will disable acceleration.

This is useful for debugging.

Signed-off-by: Alex Deucher <alexdeucher@xxxxxxxxx>
---
 drivers/gpu/drm/radeon/evergreen.c  |    2 +-
 drivers/gpu/drm/radeon/r100.c       |    2 +-
 drivers/gpu/drm/radeon/r300.c       |    2 +-
 drivers/gpu/drm/radeon/r420.c       |    2 +-
 drivers/gpu/drm/radeon/r520.c       |    2 +-
 drivers/gpu/drm/radeon/r600.c       |    2 +-
 drivers/gpu/drm/radeon/radeon.h     |    1 +
 drivers/gpu/drm/radeon/radeon_drv.c |    4 ++++
 drivers/gpu/drm/radeon/rs400.c      |    2 +-
 drivers/gpu/drm/radeon/rs600.c      |    2 +-
 drivers/gpu/drm/radeon/rs690.c      |    2 +-
 drivers/gpu/drm/radeon/rv515.c      |    2 +-
 drivers/gpu/drm/radeon/rv770.c      |    2 +-
 13 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c
b/drivers/gpu/drm/radeon/evergreen.c
index 0137a4c..af19080 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2111,7 +2111,7 @@ int evergreen_init(struct radeon_device *rdev)

 	rdev->accel_working = false;
 	r = evergreen_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
 		r700_cp_fini(rdev);
 		r600_wb_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 6443d9e..0441e80 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3738,7 +3738,7 @@ int r100_init(struct radeon_device *rdev)
 	r100_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = r100_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 590f6a8..30a9112 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -1443,7 +1443,7 @@ int r300_init(struct radeon_device *rdev)
 	r300_set_reg_safe(rdev);
 	rdev->accel_working = true;
 	r = r300_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index be092d2..ebb9017 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -376,7 +376,7 @@ int r420_init(struct radeon_device *rdev)
 	r420_set_reg_safe(rdev);
 	rdev->accel_working = true;
 	r = r420_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index 870111e..38caca5 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -290,7 +290,7 @@ int r520_init(struct radeon_device *rdev)
 	rv515_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = r520_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 4a35c54..d11632f 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2324,7 +2324,7 @@ int r600_init(struct radeon_device *rdev)

 	rdev->accel_working = true;
 	r = r600_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
 		r600_cp_fini(rdev);
 		r600_wb_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index d284270..fc0574c 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -93,6 +93,7 @@ extern int radeon_dynpm;
 extern int radeon_audio;
 extern int radeon_disp_priority;
 extern int radeon_hw_i2c;
+extern int radeon_accel;

 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
b/drivers/gpu/drm/radeon/radeon_drv.c
index 4b05563..cfe5cd8 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -95,6 +95,7 @@ int radeon_dynpm = -1;
 int radeon_audio = 1;
 int radeon_disp_priority = 0;
 int radeon_hw_i2c = 0;
+int radeon_accel = 1;

 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -144,6 +145,9 @@ module_param_named(disp_priority,
radeon_disp_priority, int, 0444);
 MODULE_PARM_DESC(hw_i2c, "hw i2c engine enable (0 = disable)");
 module_param_named(hw_i2c, radeon_hw_i2c, int, 0444);

+MODULE_PARM_DESC(accel, "acceleration (0 = disable)");
+module_param_named(accel, radeon_accel, int, 0444);
+
 static int radeon_suspend(struct drm_device *dev, pm_message_t state)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index dc76fe7..e36f193 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -528,7 +528,7 @@ int rs400_init(struct radeon_device *rdev)
 	r300_set_reg_safe(rdev);
 	rdev->accel_working = true;
 	r = rs400_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index b312b72..fbdc6be 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -789,7 +789,7 @@ int rs600_init(struct radeon_device *rdev)
 	rs600_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = rs600_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 56a0aec..1a38699 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -749,7 +749,7 @@ int rs690_init(struct radeon_device *rdev)
 	rs600_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = rs690_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index c513473..104e285 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -523,7 +523,7 @@ int rv515_init(struct radeon_device *rdev)
 	rv515_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = rv515_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index a74683e..779a89e 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -1123,7 +1123,7 @@ int rv770_init(struct radeon_device *rdev)

 	rdev->accel_working = true;
 	r = rv770_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
 		r700_cp_fini(rdev);
 		r600_wb_fini(rdev);
-- 
1.5.6.3
From 114f3491a411f50a0de1d59475fc267efd5afa6a Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@xxxxxxxxx>
Date: Fri, 23 Apr 2010 17:12:46 -0400
Subject: [PATCH] drm/radeon/kms: add accel parameter

passing accel=0 will disable acceleration.

This is useful for debugging.

Signed-off-by: Alex Deucher <alexdeucher@xxxxxxxxx>
---
 drivers/gpu/drm/radeon/evergreen.c  |    2 +-
 drivers/gpu/drm/radeon/r100.c       |    2 +-
 drivers/gpu/drm/radeon/r300.c       |    2 +-
 drivers/gpu/drm/radeon/r420.c       |    2 +-
 drivers/gpu/drm/radeon/r520.c       |    2 +-
 drivers/gpu/drm/radeon/r600.c       |    2 +-
 drivers/gpu/drm/radeon/radeon.h     |    1 +
 drivers/gpu/drm/radeon/radeon_drv.c |    4 ++++
 drivers/gpu/drm/radeon/rs400.c      |    2 +-
 drivers/gpu/drm/radeon/rs600.c      |    2 +-
 drivers/gpu/drm/radeon/rs690.c      |    2 +-
 drivers/gpu/drm/radeon/rv515.c      |    2 +-
 drivers/gpu/drm/radeon/rv770.c      |    2 +-
 13 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 0137a4c..af19080 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2111,7 +2111,7 @@ int evergreen_init(struct radeon_device *rdev)
 
 	rdev->accel_working = false;
 	r = evergreen_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
 		r700_cp_fini(rdev);
 		r600_wb_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 6443d9e..0441e80 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3738,7 +3738,7 @@ int r100_init(struct radeon_device *rdev)
 	r100_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = r100_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 590f6a8..30a9112 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -1443,7 +1443,7 @@ int r300_init(struct radeon_device *rdev)
 	r300_set_reg_safe(rdev);
 	rdev->accel_working = true;
 	r = r300_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index be092d2..ebb9017 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -376,7 +376,7 @@ int r420_init(struct radeon_device *rdev)
 	r420_set_reg_safe(rdev);
 	rdev->accel_working = true;
 	r = r420_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index 870111e..38caca5 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -290,7 +290,7 @@ int r520_init(struct radeon_device *rdev)
 	rv515_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = r520_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 4a35c54..d11632f 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -2324,7 +2324,7 @@ int r600_init(struct radeon_device *rdev)
 
 	rdev->accel_working = true;
 	r = r600_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
 		r600_cp_fini(rdev);
 		r600_wb_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index d284270..fc0574c 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -93,6 +93,7 @@ extern int radeon_dynpm;
 extern int radeon_audio;
 extern int radeon_disp_priority;
 extern int radeon_hw_i2c;
+extern int radeon_accel;
 
 /*
  * Copy from radeon_drv.h so we don't have to include both and have conflicting
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 4b05563..cfe5cd8 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -95,6 +95,7 @@ int radeon_dynpm = -1;
 int radeon_audio = 1;
 int radeon_disp_priority = 0;
 int radeon_hw_i2c = 0;
+int radeon_accel = 1;
 
 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -144,6 +145,9 @@ module_param_named(disp_priority, radeon_disp_priority, int, 0444);
 MODULE_PARM_DESC(hw_i2c, "hw i2c engine enable (0 = disable)");
 module_param_named(hw_i2c, radeon_hw_i2c, int, 0444);
 
+MODULE_PARM_DESC(accel, "acceleration (0 = disable)");
+module_param_named(accel, radeon_accel, int, 0444);
+
 static int radeon_suspend(struct drm_device *dev, pm_message_t state)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index dc76fe7..e36f193 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -528,7 +528,7 @@ int rs400_init(struct radeon_device *rdev)
 	r300_set_reg_safe(rdev);
 	rdev->accel_working = true;
 	r = rs400_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index b312b72..fbdc6be 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -789,7 +789,7 @@ int rs600_init(struct radeon_device *rdev)
 	rs600_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = rs600_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 56a0aec..1a38699 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -749,7 +749,7 @@ int rs690_init(struct radeon_device *rdev)
 	rs600_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = rs690_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index c513473..104e285 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -523,7 +523,7 @@ int rv515_init(struct radeon_device *rdev)
 	rv515_set_safe_registers(rdev);
 	rdev->accel_working = true;
 	r = rv515_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		/* Somethings want wront with the accel init stop accel */
 		dev_err(rdev->dev, "Disabling GPU acceleration\n");
 		r100_cp_fini(rdev);
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index a74683e..779a89e 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -1123,7 +1123,7 @@ int rv770_init(struct radeon_device *rdev)
 
 	rdev->accel_working = true;
 	r = rv770_startup(rdev);
-	if (r) {
+	if (r || (radeon_accel == 0)) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
 		r700_cp_fini(rdev);
 		r600_wb_fini(rdev);
-- 
1.5.6.3

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux