[Intel-gfx] [PATCH 00/12] Add more DMT and common modes

Takashi Iwai tiwai at suse.de
Thu Apr 19 16:58:14 CEST 2012


At Thu, 19 Apr 2012 14:03:58 +0200,
Takashi Iwai wrote:
> 
> At Tue, 17 Apr 2012 17:26:26 +0200,
> Takashi Iwai wrote:
> > 
> > At Fri, 13 Apr 2012 16:56:26 -0400,
> > Adam Jackson wrote:
> > > 
> > > On 4/13/12 4:33 PM, Adam Jackson wrote:
> > > > Incorporates some feedback from Rodrigo and Takashi.  Major themes of the
> > > > series:
> > > >
> > > > - Fix the DMT list to include reduced-blanking modes
> > > > - Add modes from DMT for any range descriptor type
> > > > - Add an extra modes list for things not in DMT
> > > > - For ranges that specify a formula, generate timings from the extra modes
> > > >
> > > > This still doesn't address the driver policy decision of "I know I have
> > > > a scaler, add modes as if there were a range descriptor even if there's
> > > > not one".  But it should at least make clear what such a helper function
> > > > should do.
> > > 
> > > One minor buglet in this series that's not obvious from inspection (and 
> > > that I didn't realize until just now) is that putting 1366x768 in the 
> > > minimode list won't do what you want, since the mode you get back will 
> > > be 1368x768.  Probably we should move the manual-underscan hack into the 
> > > timing generators themselves.
> > 
> > Sounds like a good compromise.  We have already hacks in drm_edid.c
> > for HDMI TV, so one exception more isn't that bad ;)
> 
> FYI, I tried the hack below and it seems working.

In addition, there are some missing NULL checks...


Takashi

---
---
 drivers/gpu/drm/drm_edid.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -789,6 +789,8 @@ drm_mode_std(struct drm_connector *conne
 		 * secondary GTF curve.  Please don't do that.
 		 */
 		mode = drm_gtf_mode(dev, hsize, vsize, vrefresh_rate, 0, 0);
+		if (!mode)
+			return NULL;
 		if (drm_mode_hsync(mode) > drm_gtf2_hbreak(edid)) {
 			kfree(mode);
 			mode = drm_gtf_mode_complex(dev, hsize, vsize,
@@ -1071,6 +1073,8 @@ drm_gtf_modes_for_range(struct drm_conne
 	for (i = 0; i < num_extra_modes; i++) {
 		const struct minimode *m = &extra_modes[i];
 		newmode = drm_gtf_mode(dev, m->w, m->h, m->r, 0, 0);
+		if (!newmode)
+			return modes;
 
 		fixup_mode_1366x768(newmode);
 		if (!mode_in_range(newmode, edid, timing)) {
@@ -1097,6 +1101,8 @@ drm_cvt_modes_for_range(struct drm_conne
 	for (i = 0; i < num_extra_modes; i++) {
 		const struct minimode *m = &extra_modes[i];
 		newmode = drm_cvt_mode(dev, m->w, m->h, m->r, rb, 0, 0);
+		if (!newmode)
+			return modes;
 
 		fixup_mode_1366x768(newmode);
 		if (!mode_in_range(newmode, edid, timing)) {



More information about the Intel-gfx mailing list