blob: ac1921928435f8d7cfd88f1ff20dabecb08c08f9 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 28c006c94e57ea71df11ec4fff79d7ffcfc4860f Mon Sep 17 00:00:00 2001
2From: Far McKon <FarMcKon@buglabs.net>
3Date: Tue, 3 May 2011 20:59:04 +0300
4Subject: [PATCH] Prevents omapfb from from crashing when pixelclock of 0 is
5 sent to it.
6
7Due to a Linux design bug it is easy to get a pixelclock set to zero
8when changing displays at runtime.
Brad Bishopd7bf8c12018-02-25 22:55:05 -05009
10Upstream-Status: Pending
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011---
12 src/omapfb-output.c | 9 +++++++--
13 1 file changed, 7 insertions(+), 2 deletions(-)
14
15diff --git a/src/omapfb-output.c b/src/omapfb-output.c
16index f8b4db3..4d59265 100644
17--- a/src/omapfb-output.c
18+++ b/src/omapfb-output.c
19@@ -125,8 +125,13 @@ OMAPFBOutputGetModes(xf86OutputPtr output)
20 /* Only populate the native (current) mode */
21 mode = calloc(1, sizeof(DisplayModeRec));
22 mode->type |= M_T_PREFERRED;
23- mode->Clock = PICOS2KHZ(ofb->state_info.pixclock);
24- mode->SynthClock = PICOS2KHZ(ofb->state_info.pixclock);
25+ if (ofb->state_info.pixclock == 0) {
26+ mode->Clock = 0;
27+ mode->SynthClock = 0;
28+ } else {
29+ mode->Clock = PICOS2KHZ(ofb->state_info.pixclock);
30+ mode->SynthClock = PICOS2KHZ(ofb->state_info.pixclock);
31+ }
32 mode->HDisplay = ofb->state_info.xres;
33 mode->HSyncStart = mode->HDisplay
34 + ofb->state_info.right_margin;
35--
362.1.4
37