Commit 18917b60 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

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.
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 44224c3f
...@@ -829,6 +829,7 @@ struct radeon_device { ...@@ -829,6 +829,7 @@ struct radeon_device {
struct r600_ih ih; /* r6/700 interrupt ring */ struct r600_ih ih; /* r6/700 interrupt ring */
struct workqueue_struct *wq; struct workqueue_struct *wq;
struct work_struct hotplug_work; struct work_struct hotplug_work;
int num_crtc; /* number of crtcs */
struct mutex dc_hw_i2c_mutex; /* display controller hw i2c mutex */ struct mutex dc_hw_i2c_mutex; /* display controller hw i2c mutex */
/* audio stuff */ /* audio stuff */
......
...@@ -831,7 +831,7 @@ static int radeon_modeset_create_props(struct radeon_device *rdev) ...@@ -831,7 +831,7 @@ static int radeon_modeset_create_props(struct radeon_device *rdev)
int radeon_modeset_init(struct radeon_device *rdev) int radeon_modeset_init(struct radeon_device *rdev)
{ {
int num_crtc = 2, i; int i;
int ret; int ret;
drm_mode_config_init(rdev->ddev); drm_mode_config_init(rdev->ddev);
...@@ -861,10 +861,12 @@ int radeon_modeset_init(struct radeon_device *rdev) ...@@ -861,10 +861,12 @@ int radeon_modeset_init(struct radeon_device *rdev)
} }
if (rdev->flags & RADEON_SINGLE_CRTC) if (rdev->flags & RADEON_SINGLE_CRTC)
num_crtc = 1; rdev->num_crtc = 1;
else
rdev->num_crtc = 2;
/* allocate crtcs */ /* allocate crtcs */
for (i = 0; i < num_crtc; i++) { for (i = 0; i < rdev->num_crtc; i++) {
radeon_crtc_init(rdev->ddev, i); radeon_crtc_init(rdev->ddev, i);
} }
......
...@@ -148,7 +148,6 @@ int radeonfb_create(struct drm_device *dev, ...@@ -148,7 +148,6 @@ int radeonfb_create(struct drm_device *dev,
unsigned long tmp; unsigned long tmp;
bool fb_tiled = false; /* useful for testing */ bool fb_tiled = false; /* useful for testing */
u32 tiling_flags = 0; u32 tiling_flags = 0;
int crtc_count;
mode_cmd.width = surface_width; mode_cmd.width = surface_width;
mode_cmd.height = surface_height; mode_cmd.height = surface_height;
...@@ -239,11 +238,7 @@ int radeonfb_create(struct drm_device *dev, ...@@ -239,11 +238,7 @@ int radeonfb_create(struct drm_device *dev,
rfbdev = info->par; rfbdev = info->par;
rfbdev->helper.funcs = &radeon_fb_helper_funcs; rfbdev->helper.funcs = &radeon_fb_helper_funcs;
rfbdev->helper.dev = dev; rfbdev->helper.dev = dev;
if (rdev->flags & RADEON_SINGLE_CRTC) ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, rdev->num_crtc,
crtc_count = 1;
else
crtc_count = 2;
ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, crtc_count,
RADEONFB_CONN_LIMIT); RADEONFB_CONN_LIMIT);
if (ret) if (ret)
goto out_unref; goto out_unref;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment