diff options
author | Dave Airlie <airlied@redhat.com> | 2014-01-21 10:47:46 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-01-23 05:01:35 +0400 |
commit | 918be888d613e58938338b4b0c895de97579173d (patch) | |
tree | d81c238aaf85a9100b7d64eed836fc684089bb3d /drivers/gpu/drm/mgag200/mgag200_fb.c | |
parent | f5395ba35f2ae52eb5839f8046e4aeef6df7f357 (diff) | |
download | linux-918be888d613e58938338b4b0c895de97579173d.tar.xz |
drm/mgag200: on cards with < 2MB VRAM default to 16-bit
This aligns with what the userspace -mga driver does in
the same situation.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_fb.c')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_fb.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index 964f58cee5ea..005b60aa2a00 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -282,6 +282,11 @@ int mgag200_fbdev_init(struct mga_device *mdev) { struct mga_fbdev *mfbdev; int ret; + int bpp_sel = 32; + + /* prefer 16bpp on low end gpus with limited VRAM */ + if (IS_G200_SE(mdev) && mdev->mc.vram_size < (2048*1024)) + bpp_sel = 16; mfbdev = devm_kzalloc(mdev->dev->dev, sizeof(struct mga_fbdev), GFP_KERNEL); if (!mfbdev) @@ -301,7 +306,7 @@ int mgag200_fbdev_init(struct mga_device *mdev) /* disable all the possible outputs/crtcs before entering KMS mode */ drm_helper_disable_unused_functions(mdev->dev); - drm_fb_helper_initial_config(&mfbdev->helper, 32); + drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel); return 0; } |