diff options
| -rw-r--r-- | drivers/gpu/drm/cirrus/cirrus_drv.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/cirrus/cirrus_drv.h | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/cirrus/cirrus_main.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/cirrus/cirrus_mode.c | 9 |
4 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index c2a1cba1e984..b9140032962d 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c | |||
| @@ -16,9 +16,12 @@ | |||
| 16 | #include "cirrus_drv.h" | 16 | #include "cirrus_drv.h" |
| 17 | 17 | ||
| 18 | int cirrus_modeset = -1; | 18 | int cirrus_modeset = -1; |
| 19 | int cirrus_bpp = 24; | ||
| 19 | 20 | ||
| 20 | MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); | 21 | MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); |
| 21 | module_param_named(modeset, cirrus_modeset, int, 0400); | 22 | module_param_named(modeset, cirrus_modeset, int, 0400); |
| 23 | MODULE_PARM_DESC(bpp, "Max bits-per-pixel (default:24)"); | ||
| 24 | module_param_named(bpp, cirrus_bpp, int, 0400); | ||
| 22 | 25 | ||
| 23 | /* | 26 | /* |
| 24 | * This is the generic driver code. This binds the driver to the drm core, | 27 | * This is the generic driver code. This binds the driver to the drm core, |
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index 693a4565c4ff..705061537a27 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h | |||
| @@ -262,4 +262,7 @@ static inline void cirrus_bo_unreserve(struct cirrus_bo *bo) | |||
| 262 | 262 | ||
| 263 | int cirrus_bo_push_sysram(struct cirrus_bo *bo); | 263 | int cirrus_bo_push_sysram(struct cirrus_bo *bo); |
| 264 | int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr); | 264 | int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr); |
| 265 | |||
| 266 | extern int cirrus_bpp; | ||
| 267 | |||
| 265 | #endif /* __CIRRUS_DRV_H__ */ | 268 | #endif /* __CIRRUS_DRV_H__ */ |
diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c index 4c2d68e9102d..e4b976658087 100644 --- a/drivers/gpu/drm/cirrus/cirrus_main.c +++ b/drivers/gpu/drm/cirrus/cirrus_main.c | |||
| @@ -320,6 +320,8 @@ bool cirrus_check_framebuffer(struct cirrus_device *cdev, int width, int height, | |||
| 320 | const int max_pitch = 0x1FF << 3; /* (4096 - 1) & ~111b bytes */ | 320 | const int max_pitch = 0x1FF << 3; /* (4096 - 1) & ~111b bytes */ |
| 321 | const int max_size = cdev->mc.vram_size; | 321 | const int max_size = cdev->mc.vram_size; |
| 322 | 322 | ||
| 323 | if (bpp > cirrus_bpp) | ||
| 324 | return false; | ||
| 323 | if (bpp > 32) | 325 | if (bpp > 32) |
| 324 | return false; | 326 | return false; |
| 325 | 327 | ||
diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index 99d4a74ffeaf..61385f2298bf 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c | |||
| @@ -501,8 +501,13 @@ static int cirrus_vga_get_modes(struct drm_connector *connector) | |||
| 501 | int count; | 501 | int count; |
| 502 | 502 | ||
| 503 | /* Just add a static list of modes */ | 503 | /* Just add a static list of modes */ |
| 504 | count = drm_add_modes_noedid(connector, 1280, 1024); | 504 | if (cirrus_bpp <= 24) { |
| 505 | drm_set_preferred_mode(connector, 1024, 768); | 505 | count = drm_add_modes_noedid(connector, 1280, 1024); |
| 506 | drm_set_preferred_mode(connector, 1024, 768); | ||
| 507 | } else { | ||
| 508 | count = drm_add_modes_noedid(connector, 800, 600); | ||
| 509 | drm_set_preferred_mode(connector, 800, 600); | ||
| 510 | } | ||
| 506 | return count; | 511 | return count; |
| 507 | } | 512 | } |
| 508 | 513 | ||
