Commit 3aad16d2 authored by Alan Cox's avatar Alan Cox Committed by Dave Airlie

gma500: support 1080p

The problem in console mode is lack of linear memory. We can solve that by
dropping to 16bpp. The mode setting X server will allocate its own GEM
framebuffer in 32bpp and all will be well.

We could just do 16bpp anyway but that would be a regression on the lower
modes as many distributions don't yet ship the generic mode setting KMS
drivers.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 1b2db4ce
...@@ -67,7 +67,6 @@ static void cdv_intel_crt_dpms(struct drm_encoder *encoder, int mode) ...@@ -67,7 +67,6 @@ static void cdv_intel_crt_dpms(struct drm_encoder *encoder, int mode)
static int cdv_intel_crt_mode_valid(struct drm_connector *connector, static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_psb_private *dev_priv = connector->dev->dev_private;
int max_clock = 0; int max_clock = 0;
if (mode->flags & DRM_MODE_FLAG_DBLSCAN) if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
return MODE_NO_DBLESCAN; return MODE_NO_DBLESCAN;
...@@ -84,11 +83,6 @@ static int cdv_intel_crt_mode_valid(struct drm_connector *connector, ...@@ -84,11 +83,6 @@ static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
if (mode->hdisplay > 1680 || mode->vdisplay > 1050) if (mode->hdisplay > 1680 || mode->vdisplay > 1050)
return MODE_PANEL; return MODE_PANEL;
/* We assume worst case scenario of 32 bpp here, since we don't know */
if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
dev_priv->vram_stolen_size)
return MODE_MEM;
return MODE_OK; return MODE_OK;
} }
......
...@@ -242,8 +242,6 @@ static int cdv_hdmi_get_modes(struct drm_connector *connector) ...@@ -242,8 +242,6 @@ static int cdv_hdmi_get_modes(struct drm_connector *connector)
static int cdv_hdmi_mode_valid(struct drm_connector *connector, static int cdv_hdmi_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_psb_private *dev_priv = connector->dev->dev_private;
if (mode->clock > 165000) if (mode->clock > 165000)
return MODE_CLOCK_HIGH; return MODE_CLOCK_HIGH;
if (mode->clock < 20000) if (mode->clock < 20000)
...@@ -257,11 +255,6 @@ static int cdv_hdmi_mode_valid(struct drm_connector *connector, ...@@ -257,11 +255,6 @@ static int cdv_hdmi_mode_valid(struct drm_connector *connector,
if (mode->flags & DRM_MODE_FLAG_INTERLACE) if (mode->flags & DRM_MODE_FLAG_INTERLACE)
return MODE_NO_INTERLACE; return MODE_NO_INTERLACE;
/* We assume worst case scenario of 32 bpp here, since we don't know */
if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
dev_priv->vram_stolen_size)
return MODE_MEM;
return MODE_OK; return MODE_OK;
} }
......
...@@ -543,9 +543,25 @@ static int psbfb_probe(struct drm_fb_helper *helper, ...@@ -543,9 +543,25 @@ static int psbfb_probe(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes) struct drm_fb_helper_surface_size *sizes)
{ {
struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper; struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper;
struct drm_device *dev = psb_fbdev->psb_fb_helper.dev;
struct drm_psb_private *dev_priv = dev->dev_private;
int new_fb = 0; int new_fb = 0;
int bytespp;
int ret; int ret;
bytespp = sizes->surface_bpp / 8;
if (bytespp == 3) /* no 24bit packed */
bytespp = 4;
/* If the mode will not fit in 32bit then switch to 16bit to get
a console on full resolution. The X mode setting server will
allocate its own 32bit GEM framebuffer */
if (ALIGN(sizes->fb_width * bytespp, 64) * sizes->fb_height >
dev_priv->vram_stolen_size) {
sizes->surface_bpp = 16;
sizes->surface_depth = 16;
}
if (!helper->fb) { if (!helper->fb) {
ret = psbfb_create(psb_fbdev, sizes); ret = psbfb_create(psb_fbdev, sizes);
if (ret) if (ret)
......
...@@ -179,7 +179,6 @@ static void oaktrail_hdmi_dpms(struct drm_encoder *encoder, int mode) ...@@ -179,7 +179,6 @@ static void oaktrail_hdmi_dpms(struct drm_encoder *encoder, int mode)
static int oaktrail_hdmi_mode_valid(struct drm_connector *connector, static int oaktrail_hdmi_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_psb_private *dev_priv = connector->dev->dev_private;
if (mode->clock > 165000) if (mode->clock > 165000)
return MODE_CLOCK_HIGH; return MODE_CLOCK_HIGH;
if (mode->clock < 20000) if (mode->clock < 20000)
...@@ -188,11 +187,6 @@ static int oaktrail_hdmi_mode_valid(struct drm_connector *connector, ...@@ -188,11 +187,6 @@ static int oaktrail_hdmi_mode_valid(struct drm_connector *connector,
if (mode->flags & DRM_MODE_FLAG_DBLSCAN) if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
return MODE_NO_DBLESCAN; return MODE_NO_DBLESCAN;
/* We assume worst case scenario of 32 bpp here, since we don't know */
if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
dev_priv->vram_stolen_size)
return MODE_MEM;
return MODE_OK; return MODE_OK;
} }
......
...@@ -1141,7 +1141,6 @@ static void psb_intel_sdvo_dpms(struct drm_encoder *encoder, int mode) ...@@ -1141,7 +1141,6 @@ static void psb_intel_sdvo_dpms(struct drm_encoder *encoder, int mode)
static int psb_intel_sdvo_mode_valid(struct drm_connector *connector, static int psb_intel_sdvo_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
struct drm_psb_private *dev_priv = connector->dev->dev_private;
struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector); struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector);
if (mode->flags & DRM_MODE_FLAG_DBLSCAN) if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
...@@ -1161,11 +1160,6 @@ static int psb_intel_sdvo_mode_valid(struct drm_connector *connector, ...@@ -1161,11 +1160,6 @@ static int psb_intel_sdvo_mode_valid(struct drm_connector *connector,
return MODE_PANEL; return MODE_PANEL;
} }
/* We assume worst case scenario of 32 bpp here, since we don't know */
if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
dev_priv->vram_stolen_size)
return MODE_MEM;
return MODE_OK; return MODE_OK;
} }
......
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