All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Adam Jackson <ajax@redhat.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH 00/12] Add more DMT and common modes
Date: Thu, 19 Apr 2012 14:03:58 +0200	[thread overview]
Message-ID: <s5h4nsg6i8h.wl%tiwai@suse.de> (raw)
In-Reply-To: <s5h1unmqt0d.wl%tiwai@suse.de>

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.


Takashi

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

--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1047,6 +1047,19 @@ drm_dmt_modes_for_range(struct drm_conne
 	return modes;
 }
 
+/* fix up 1366x768 mode from 1368x768;
+ * GTF/CVT can't express 1366 width which isn't dividable by 8
+ */
+static void fixup_mode_1366x768(struct drm_display_mode *mode)
+{
+	if (mode->hdisplay == 1368 && mode->vdisplay == 768) {
+		mode->hdisplay = 1366;
+		mode->hsync_start--;
+		mode->hsync_end--;
+		drm_mode_set_name(mode);
+	}
+}
+
 static int
 drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
 			struct detailed_timing *timing)
@@ -1059,6 +1072,7 @@ drm_gtf_modes_for_range(struct drm_conne
 		const struct minimode *m = &extra_modes[i];
 		newmode = drm_gtf_mode(dev, m->w, m->h, m->r, 0, 0);
 
+		fixup_mode_1366x768(newmode);
 		if (!mode_in_range(newmode, edid, timing)) {
 			drm_mode_destroy(dev, newmode);
 			continue;
@@ -1084,6 +1098,7 @@ drm_cvt_modes_for_range(struct drm_conne
 		const struct minimode *m = &extra_modes[i];
 		newmode = drm_cvt_mode(dev, m->w, m->h, m->r, rb, 0, 0);
 
+		fixup_mode_1366x768(newmode);
 		if (!mode_in_range(newmode, edid, timing)) {
 			drm_mode_destroy(dev, newmode);
 			continue;

  reply	other threads:[~2012-04-19 12:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13 20:33 [PATCH 00/12] Add more DMT and common modes Adam Jackson
2012-04-13 20:33 ` [PATCH 01/12] drm/edid: Document drm_mode_find_dmt Adam Jackson
2012-04-13 20:33 ` [PATCH 02/12] drm/edid: Rewrite drm_mode_find_dmt search loop Adam Jackson
2012-04-13 20:33 ` [PATCH 03/12] drm/edid: Allow drm_mode_find_dmt to hunt for reduced-blanking modes Adam Jackson
2012-04-13 20:33 ` [PATCH 04/12] drm/edid: Remove a misleading comment Adam Jackson
2012-04-13 20:33 ` [PATCH 05/12] drm/edid: s/drm_gtf_modes_for_range/drm_dmt_modes_for_range/ Adam Jackson
2012-04-13 20:33 ` [PATCH 06/12] drm/edid: Add the reduced blanking DMT modes to the DMT list Adam Jackson
2012-04-13 20:33 ` [PATCH 07/12] drm/edid: Fix some comment typos in the DMT mode list Adam Jackson
2012-04-13 20:33 ` [PATCH 08/12] drm/edid: Do drm_dmt_modes_for_range() for all range descriptor types Adam Jackson
2012-04-13 20:33 ` [PATCH 09/12] drm/edid: Update range descriptor struct for EDID 1.4 Adam Jackson
2012-04-17 15:25   ` [Intel-gfx] " Takashi Iwai
2012-04-17 17:17     ` Adam Jackson
2012-04-13 20:33 ` [PATCH 10/12] drm/edid: Give the est3 mode struct a real name Adam Jackson
2012-04-13 20:33 ` [PATCH 11/12] drm/edid: Add extra_modes Adam Jackson
2012-04-13 20:33 ` [PATCH 12/12] drm/edid: Generate modes from extra_modes for range descriptors Adam Jackson
2012-04-13 20:56 ` [PATCH 00/12] Add more DMT and common modes Adam Jackson
2012-04-17 15:26   ` [Intel-gfx] " Takashi Iwai
2012-04-19 12:03     ` Takashi Iwai [this message]
2012-04-19 14:58       ` Takashi Iwai
2012-04-20 12:05         ` Dave Airlie
2012-04-20 12:34           ` Takashi Iwai
2012-04-20 12:04       ` [Intel-gfx] " Dave Airlie
2012-04-20 12:32         ` Takashi Iwai
2012-04-17 15:33 ` Takashi Iwai
2012-04-17 15:50   ` Takashi Iwai
2012-04-17 16:02     ` Rodrigo Vivi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h4nsg6i8h.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=ajax@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.