diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fb.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 1ba704eedefb..b38c4c8e2c61 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c | |||
@@ -55,6 +55,7 @@ static struct fb_ops radeonfb_ops = { | |||
55 | .fb_imageblit = cfb_imageblit, | 55 | .fb_imageblit = cfb_imageblit, |
56 | .fb_pan_display = drm_fb_helper_pan_display, | 56 | .fb_pan_display = drm_fb_helper_pan_display, |
57 | .fb_blank = drm_fb_helper_blank, | 57 | .fb_blank = drm_fb_helper_blank, |
58 | .fb_setcmap = drm_fb_helper_setcmap, | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | /** | 61 | /** |
@@ -123,6 +124,7 @@ static int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bo | |||
123 | 124 | ||
124 | static struct drm_fb_helper_funcs radeon_fb_helper_funcs = { | 125 | static struct drm_fb_helper_funcs radeon_fb_helper_funcs = { |
125 | .gamma_set = radeon_crtc_fb_gamma_set, | 126 | .gamma_set = radeon_crtc_fb_gamma_set, |
127 | .gamma_get = radeon_crtc_fb_gamma_get, | ||
126 | }; | 128 | }; |
127 | 129 | ||
128 | int radeonfb_create(struct drm_device *dev, | 130 | int radeonfb_create(struct drm_device *dev, |
@@ -146,9 +148,15 @@ int radeonfb_create(struct drm_device *dev, | |||
146 | unsigned long tmp; | 148 | unsigned long tmp; |
147 | bool fb_tiled = false; /* useful for testing */ | 149 | bool fb_tiled = false; /* useful for testing */ |
148 | u32 tiling_flags = 0; | 150 | u32 tiling_flags = 0; |
151 | int crtc_count; | ||
149 | 152 | ||
150 | mode_cmd.width = surface_width; | 153 | mode_cmd.width = surface_width; |
151 | mode_cmd.height = surface_height; | 154 | mode_cmd.height = surface_height; |
155 | |||
156 | /* avivo can't scanout real 24bpp */ | ||
157 | if ((surface_bpp == 24) && ASIC_IS_AVIVO(rdev)) | ||
158 | surface_bpp = 32; | ||
159 | |||
152 | mode_cmd.bpp = surface_bpp; | 160 | mode_cmd.bpp = surface_bpp; |
153 | /* need to align pitch with crtc limits */ | 161 | /* need to align pitch with crtc limits */ |
154 | mode_cmd.pitch = radeon_align_pitch(rdev, mode_cmd.width, mode_cmd.bpp, fb_tiled) * ((mode_cmd.bpp + 1) / 8); | 162 | mode_cmd.pitch = radeon_align_pitch(rdev, mode_cmd.width, mode_cmd.bpp, fb_tiled) * ((mode_cmd.bpp + 1) / 8); |
@@ -217,7 +225,11 @@ int radeonfb_create(struct drm_device *dev, | |||
217 | rfbdev = info->par; | 225 | rfbdev = info->par; |
218 | rfbdev->helper.funcs = &radeon_fb_helper_funcs; | 226 | rfbdev->helper.funcs = &radeon_fb_helper_funcs; |
219 | rfbdev->helper.dev = dev; | 227 | rfbdev->helper.dev = dev; |
220 | ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, 2, | 228 | if (rdev->flags & RADEON_SINGLE_CRTC) |
229 | crtc_count = 1; | ||
230 | else | ||
231 | crtc_count = 2; | ||
232 | ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, crtc_count, | ||
221 | RADEONFB_CONN_LIMIT); | 233 | RADEONFB_CONN_LIMIT); |
222 | if (ret) | 234 | if (ret) |
223 | goto out_unref; | 235 | goto out_unref; |
@@ -234,7 +246,7 @@ int radeonfb_create(struct drm_device *dev, | |||
234 | 246 | ||
235 | strcpy(info->fix.id, "radeondrmfb"); | 247 | strcpy(info->fix.id, "radeondrmfb"); |
236 | 248 | ||
237 | drm_fb_helper_fill_fix(info, fb->pitch); | 249 | drm_fb_helper_fill_fix(info, fb->pitch, fb->depth); |
238 | 250 | ||
239 | info->flags = FBINFO_DEFAULT; | 251 | info->flags = FBINFO_DEFAULT; |
240 | info->fbops = &radeonfb_ops; | 252 | info->fbops = &radeonfb_ops; |
@@ -309,7 +321,7 @@ int radeon_parse_options(char *options) | |||
309 | 321 | ||
310 | int radeonfb_probe(struct drm_device *dev) | 322 | int radeonfb_probe(struct drm_device *dev) |
311 | { | 323 | { |
312 | return drm_fb_helper_single_fb_probe(dev, &radeonfb_create); | 324 | return drm_fb_helper_single_fb_probe(dev, 32, &radeonfb_create); |
313 | } | 325 | } |
314 | 326 | ||
315 | int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb) | 327 | int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb) |