Skip to contentSkip to conversation

drm/radeon/kms: consolidate crtc count in rdev

PATCH New Alex Deucher 1 participant 1 message Feb 1, 2010

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

PATCH 1/1 drm/radeon/kms: consolidate crtc count in rdev

Quoted 1 line

From b3f9e7f481506058174154d5c6fa8e1cd0c56918 Mon Sep 17 00:00:00 2001

From: Alex Deucher <[email protected]>
Date: Mon, 1 Feb 2010 16:02:25 -0500
Subject: [PATCH] drm/radeon/kms: consolidate crtc count in rdev

Set the number of crtcs in rdev at crtc init and use it whenever we need the crtc count rather than recalculating it everytime.

---
 drivers/gpu/drm/radeon/radeon.h         |    1 +
 drivers/gpu/drm/radeon/radeon_display.c |    8 +++++---
 drivers/gpu/drm/radeon/radeon_fb.c      |    7 +------
 3 files changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/radeon/radeon.h +1 -0
index 2d5f2bf..a85bea4 100644
@@ -822,6 +822,7 @@ struct radeon_device {
 	struct r600_ih ih; /* r6/700 interrupt ring */
 	struct workqueue_struct *wq;
 	struct work_struct hotplug_work;
+	int num_crtc; /* number of crtcs */
 
 	/* audio stuff */
 	struct timer_list	audio_timer;
(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/radeon_display.c
index 6a92f99..e874c05 100644

drivers/gpu/drm/radeon/radeon_display.c +0 -0
@@ -810,7 +810,7 @@ static int radeon_modeset_create_props(struct

radeon_device *rdev)

int radeon_modeset_init(struct radeon_device *rdev) {
- int num_crtc = 2, i;
+ int i;
int ret;

drm_mode_config_init(rdev->ddev);
@@ -834,10 +834,12 @@ int radeon_modeset_init(struct radeon_device *rdev)
}

if (rdev->flags & RADEON_SINGLE_CRTC)
- num_crtc = 1;
+ rdev->num_crtc = 1;
+ else
+ rdev->num_crtc = 2;

/* allocate crtcs */
- for (i = 0; i < num_crtc; i++) {
+ for (i = 0; i < rdev->num_crtc; i++) {
radeon_crtc_init(rdev->ddev, i);
}

(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/radeon_fb.c
index 66055b3..105c678 100644

drivers/gpu/drm/radeon/radeon_fb.c +1 -6
@@ -148,7 +148,6 @@ int radeonfb_create(struct drm_device *dev,
 	unsigned long tmp;
 	bool fb_tiled = false; /* useful for testing */
 	u32 tiling_flags = 0;
-	int crtc_count;
 
 	mode_cmd.width = surface_width;
 	mode_cmd.height = surface_height;
@@ -239,11 +238,7 @@ int radeonfb_create(struct drm_device *dev,
 	rfbdev = info->par;
 	rfbdev->helper.funcs = &radeon_fb_helper_funcs;
 	rfbdev->helper.dev = dev;
-	if (rdev->flags & RADEON_SINGLE_CRTC)
-		crtc_count = 1;
-	else
-		crtc_count = 2;
-	ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, crtc_count,
+	ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, rdev->num_crtc,
 					    RADEONFB_CONN_LIMIT);
 	if (ret)
 		goto out_unref;
Signature · 1 line
1.5.6.3

From b3f9e7f481506058174154d5c6fa8e1cd0c56918 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Mon, 1 Feb 2010 16:02:25 -0500
Subject: [PATCH] drm/radeon/kms: consolidate crtc count in rdev

Set the number of crtcs in rdev at crtc init and use it whenever we need the crtc count rather than recalculating it everytime.

---
 drivers/gpu/drm/radeon/radeon.h         |    1 +
 drivers/gpu/drm/radeon/radeon_display.c |    8 +++++---
 drivers/gpu/drm/radeon/radeon_fb.c      |    7 +------
 3 files changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/radeon/radeon.h +1 -0
index 2d5f2bf..a85bea4 100644
@@ -822,6 +822,7 @@ struct radeon_device {
 	struct r600_ih ih; /* r6/700 interrupt ring */
 	struct workqueue_struct *wq;
 	struct work_struct hotplug_work;
+	int num_crtc; /* number of crtcs */
 
 	/* audio stuff */
 	struct timer_list	audio_timer;
drivers/gpu/drm/radeon/radeon_display.c +5 -3
index 6a92f99..e874c05 100644
@@ -810,7 +810,7 @@ static int radeon_modeset_create_props(struct radeon_device *rdev)
 
 int radeon_modeset_init(struct radeon_device *rdev)
 {
-	int num_crtc = 2, i;
+	int i;
 	int ret;
 
 	drm_mode_config_init(rdev->ddev);
@@ -834,10 +834,12 @@ int radeon_modeset_init(struct radeon_device *rdev)
 	}
 
 	if (rdev->flags & RADEON_SINGLE_CRTC)
-		num_crtc = 1;
+		rdev->num_crtc = 1;
+	else
+		rdev->num_crtc = 2;
 
 	/* allocate crtcs */
-	for (i = 0; i < num_crtc; i++) {
+	for (i = 0; i < rdev->num_crtc; i++) {
 		radeon_crtc_init(rdev->ddev, i);
 	}
 
drivers/gpu/drm/radeon/radeon_fb.c +1 -6
index 66055b3..105c678 100644
@@ -148,7 +148,6 @@ int radeonfb_create(struct drm_device *dev,
 	unsigned long tmp;
 	bool fb_tiled = false; /* useful for testing */
 	u32 tiling_flags = 0;
-	int crtc_count;
 
 	mode_cmd.width = surface_width;
 	mode_cmd.height = surface_height;
@@ -239,11 +238,7 @@ int radeonfb_create(struct drm_device *dev,
 	rfbdev = info->par;
 	rfbdev->helper.funcs = &radeon_fb_helper_funcs;
 	rfbdev->helper.dev = dev;
-	if (rdev->flags & RADEON_SINGLE_CRTC)
-		crtc_count = 1;
-	else
-		crtc_count = 2;
-	ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, crtc_count,
+	ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, rdev->num_crtc,
 					    RADEONFB_CONN_LIMIT);
 	if (ret)
 		goto out_unref;
Signature · 1 line
1.5.6.3

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

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