Skip to contentSkip to conversation

drm/radeon/kms/evergreen: set accel_enabled

PATCH In review Alex Deucher 2 participants 3 messages Jun 3, 2010 – Jun 4, 2010

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

PATCH 1/1 drm/radeon/kms/evergreen: set accel_enabled

This is needed to enable accel in the ddx. However, due to a bug in older versions of the ddx, it relies on accel being disabled in order to load properly on evergreen chips. To maintain compatility, we add a new get accel param and call that from the ddx. The old one always returns false for evergreen cards.

---
 drivers/gpu/drm/radeon/evergreen.c  |    2 +-
 drivers/gpu/drm/radeon/radeon_drv.c |    3 ++-
 drivers/gpu/drm/radeon/radeon_kms.c |    9 ++++++++-
 include/drm/radeon_drm.h            |    1 +
 4 files changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +1 -1
index 0440c09..49c94ae 100644
@@ -2153,7 +2153,7 @@ int evergreen_init(struct radeon_device *rdev)
 	if (r)
 		return r;
 
-	rdev->accel_working = false;
+	rdev->accel_working = true;
 	r = evergreen_startup(rdev);
 	if (r) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
drivers/gpu/drm/radeon/radeon_drv.c +2 -1
index 902d173..e166fe4 100644
@@ -45,9 +45,10 @@
  * - 2.2.0 - add r6xx/r7xx const buffer support
  * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
  * - 2.4.0 - add crtc id query
+ * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
  */
 #define KMS_DRIVER_MAJOR	2
-#define KMS_DRIVER_MINOR	4
+#define KMS_DRIVER_MINOR	5
 #define KMS_DRIVER_PATCHLEVEL	0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
drivers/gpu/drm/radeon/radeon_kms.c +8 -1
index 0406835..6a70c0d 100644
@@ -118,7 +118,11 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 		value = rdev->num_z_pipes;
 		break;
 	case RADEON_INFO_ACCEL_WORKING:
-		value = rdev->accel_working;
+		/* xf86-video-ati 6.13.0 relies on this being false for evergreen */
+		if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK))
+			value = false;
+		else
+			value = rdev->accel_working;
 		break;
 	case RADEON_INFO_CRTC_FROM_ID:
 		for (i = 0, found = 0; i < rdev->num_crtc; i++) {
@@ -134,6 +138,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 			return -EINVAL;
 		}
 		break;
+	case RADEON_INFO_ACCEL_WORKING2:
+		value = rdev->accel_working;
+		break;
 	default:
 		DRM_DEBUG("Invalid request %d\n", info->request);
 		return -EINVAL;
include/drm/radeon_drm.h +1 -0
index 3ff9fc0..5347063 100644
@@ -903,6 +903,7 @@ struct drm_radeon_cs {
 #define RADEON_INFO_NUM_Z_PIPES 	0x02
 #define RADEON_INFO_ACCEL_WORKING	0x03
 #define RADEON_INFO_CRTC_FROM_ID	0x04
+#define RADEON_INFO_ACCEL_WORKING2	0x05
 
 struct drm_radeon_info {
 	uint32_t		request;
Signature · 1 line
1.7.0.1
#1 lore raw
Quoted 8 lines · Alex Deucher

This is needed to enable accel in the ddx. However, due to a bug in older versions of the ddx, it relies on accel being disabled in order to load properly on evergreen chips. To maintain compatility, we add a new get accel param and call that from the ddx. The old one always returns false for evergreen cards.

I am not sure i understand how it happened ? This really bad that we have to add accel working2, this is ugly...

I am waiting for accel_working3

Cheers,
Jerome

Quoted 82 lines
---
 drivers/gpu/drm/radeon/evergreen.c  |    2 +-
 drivers/gpu/drm/radeon/radeon_drv.c |    3 ++-
 drivers/gpu/drm/radeon/radeon_kms.c |    9 ++++++++-
 include/drm/radeon_drm.h            |    1 +
 4 files changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +1 -1
index 0440c09..49c94ae 100644
@@ -2153,7 +2153,7 @@ int evergreen_init(struct radeon_device *rdev)
 	if (r)
 		return r;
 
-	rdev->accel_working = false;
+	rdev->accel_working = true;
 	r = evergreen_startup(rdev);
 	if (r) {
 		dev_err(rdev->dev, "disabling GPU acceleration\n");
drivers/gpu/drm/radeon/radeon_drv.c +2 -1
index 902d173..e166fe4 100644
@@ -45,9 +45,10 @@
  * - 2.2.0 - add r6xx/r7xx const buffer support
  * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
  * - 2.4.0 - add crtc id query
+ * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
  */
 #define KMS_DRIVER_MAJOR	2
-#define KMS_DRIVER_MINOR	4
+#define KMS_DRIVER_MINOR	5
 #define KMS_DRIVER_PATCHLEVEL	0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
drivers/gpu/drm/radeon/radeon_kms.c +8 -1
index 0406835..6a70c0d 100644
@@ -118,7 +118,11 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 		value = rdev->num_z_pipes;
 		break;
 	case RADEON_INFO_ACCEL_WORKING:
-		value = rdev->accel_working;
+		/* xf86-video-ati 6.13.0 relies on this being false for evergreen */
+		if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK))
+			value = false;
+		else
+			value = rdev->accel_working;
 		break;
 	case RADEON_INFO_CRTC_FROM_ID:
 		for (i = 0, found = 0; i < rdev->num_crtc; i++) {
@@ -134,6 +138,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 			return -EINVAL;
 		}
 		break;
+	case RADEON_INFO_ACCEL_WORKING2:
+		value = rdev->accel_working;
+		break;
 	default:
 		DRM_DEBUG("Invalid request %d\n", info->request);
 		return -EINVAL;
include/drm/radeon_drm.h +1 -0
index 3ff9fc0..5347063 100644
@@ -903,6 +903,7 @@ struct drm_radeon_cs {
 #define RADEON_INFO_NUM_Z_PIPES 	0x02
 #define RADEON_INFO_ACCEL_WORKING	0x03
 #define RADEON_INFO_CRTC_FROM_ID	0x04
+#define RADEON_INFO_ACCEL_WORKING2	0x05
 
 struct drm_radeon_info {
 	uint32_t		request;
Signature · 6 lines
1.7.0.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 8 lines · Jerome Glisse
Quoted 7 lines · Alex Deucher

This is needed to enable accel in the ddx.  However, due to a bug in older versions of the ddx, it relies on accel being disabled in order to load properly on evergreen chips.  To maintain compatility, we add a new get accel param and call that from the ddx.  The old one always returns false for evergreen cards.

Quoted 5 lines
Quoted 1 line

I am not sure i understand how it happened ? This really bad that we have to add accel working2, this is ugly...

Yeah it sucks. Unfortunately I forgot to explicitly disable accel on evergreen when we released 6.13.0 so it relies on accel working to return false, otherwise it tries to init accel.

Alex

Quoted 88 lines

I am waiting for accel_working3

Cheers,
Jerome

Quoted 82 lines

---
 drivers/gpu/drm/radeon/evergreen.c  |    2 +- drivers/gpu/drm/radeon/radeon_drv.c |    3 ++- drivers/gpu/drm/radeon/radeon_kms.c |    9 ++++++++- include/drm/radeon_drm.h            |    1 +

 4 files changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +1 -1
index 0440c09..49c94ae 100644
@@ -2153,7 +2153,7 @@ int evergreen_init(struct radeon_device *rdev)
       if (r)
               return r;
 
-     rdev->accel_working = false;
+     rdev->accel_working = true;
       r = evergreen_startup(rdev);
       if (r) {
               dev_err(rdev->dev, "disabling GPU acceleration\n");
drivers/gpu/drm/radeon/radeon_drv.c +2 -1
index 902d173..e166fe4 100644
@@ -45,9 +45,10 @@
   * - 2.2.0 - add r6xx/r7xx const buffer support
   * - 2.3.0 - add MSPOS + 3D texture + r500 VAP regs
   * - 2.4.0 - add crtc id query
+ * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen
   */
  #define KMS_DRIVER_MAJOR     2
-#define KMS_DRIVER_MINOR     4
+#define KMS_DRIVER_MINOR     5
  #define KMS_DRIVER_PATCHLEVEL        0
  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
  int radeon_driver_unload_kms(struct drm_device *dev);
drivers/gpu/drm/radeon/radeon_kms.c +0 -0
index 0406835..6a70c0d 100644
@@ -118,7 +118,11 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
               value = rdev->num_z_pipes;
               break;

      case RADEON_INFO_ACCEL_WORKING:
-             value = rdev->accel_working;
+             /* xf86-video-ati 6.13.0 relies on this being false for evergreen */
+             if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK))
+                     value = false;
+             else
+                     value = rdev->accel_working;
              break;
      case RADEON_INFO_CRTC_FROM_ID:
              for (i = 0, found = 0; i < rdev->num_crtc; i++) {

drivers/gpu/drm/radeon/radeon_kms.c +3 -0
@@ -134,6 +138,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                       return -EINVAL;
               }
               break;
+     case RADEON_INFO_ACCEL_WORKING2:
+             value = rdev->accel_working;
+             break;

      default:
              DRM_DEBUG("Invalid request %d\n", info->request); return -EINVAL;

include/drm/radeon_drm.h +1 -1
index 3ff9fc0..5347063 100644
@@ -903,6 +903,7 @@ struct drm_radeon_cs {
  #define RADEON_INFO_NUM_Z_PIPES      0x02
  #define RADEON_INFO_ACCEL_WORKING    0x03
  #define RADEON_INFO_CRTC_FROM_ID     0x04
+#define RADEON_INFO_ACCEL_WORKING2   0x05
 
  struct drm_radeon_info {
       uint32_t                request;
--

1.7.0.1

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