aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2012-01-12 09:40:12 -0500
committerDave Airlie <airlied@redhat.com>2012-01-13 04:02:06 -0500
commit9f821c675a389cf4aab7f1dc8ee0860fba4f3204 (patch)
tree5c4dde154e229e235da1d91624aba163d9c88cb6 /drivers/gpu/drm/gma500/cdv_intel_hdmi.c
parentafe887df1c3806da98d4edfeef7794d11eb0fe16 (diff)
gma500: Discard modes that don't fit in stolen memory
[This fixes a crash on boot if the system is plugged into an HDTV so it's probably appropriate to push even though it didn't make the window. We could be cleverer about this but the simple version seems to be the safe one] From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> At the moment we cannot allocate more than stolen memory size for framebuffers. To get around that issues we discard modes that doesn't fit. This is a temporary solution until we can freely allocate framebuffer memory. [Currently the framebuffer needs to be linear in kernel space due to limits in the kernel fb layer - AC] Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/cdv_intel_hdmi.c')
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_hdmi.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 50d7cfb51662..de25560e629d 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -241,6 +241,7 @@ static int cdv_hdmi_get_modes(struct drm_connector *connector)
241static int cdv_hdmi_mode_valid(struct drm_connector *connector, 241static int cdv_hdmi_mode_valid(struct drm_connector *connector,
242 struct drm_display_mode *mode) 242 struct drm_display_mode *mode)
243{ 243{
244 struct drm_psb_private *dev_priv = connector->dev->dev_private;
244 245
245 if (mode->clock > 165000) 246 if (mode->clock > 165000)
246 return MODE_CLOCK_HIGH; 247 return MODE_CLOCK_HIGH;
@@ -255,14 +256,11 @@ static int cdv_hdmi_mode_valid(struct drm_connector *connector,
255 if (mode->flags & DRM_MODE_FLAG_INTERLACE) 256 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
256 return MODE_NO_INTERLACE; 257 return MODE_NO_INTERLACE;
257 258
258 /* 259 /* We assume worst case scenario of 32 bpp here, since we don't know */
259 * FIXME: for now we limit the size to 1680x1050 on CDV, otherwise it 260 if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
260 * will go beyond the stolen memory size allocated to the framebuffer 261 dev_priv->vram_stolen_size)
261 */ 262 return MODE_MEM;
262 if (mode->hdisplay > 1680) 263
263 return MODE_PANEL;
264 if (mode->vdisplay > 1050)
265 return MODE_PANEL;
266 return MODE_OK; 264 return MODE_OK;
267} 265}
268 266