From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752666AbdAZOsv (ORCPT ); Thu, 26 Jan 2017 09:48:51 -0500 Received: from mga05.intel.com ([192.55.52.43]:2233 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbdAZOst (ORCPT ); Thu, 26 Jan 2017 09:48:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,289,1477983600"; d="scan'208";a="1099235420" Date: Thu, 26 Jan 2017 16:48:45 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Takashi Iwai , dri-devel@lists.freedesktop.org, Gustavo Padovan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] drm: Clean up the 1366x768 fixup codes Message-ID: <20170126144845.GG31595@intel.com> References: <20170117164329.10551-1-tiwai@suse.de> <20170120194617.GI31595@intel.com> <20170123082352.qdebvg6a2lyohub3@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170123082352.qdebvg6a2lyohub3@phenom.ffwll.local> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 23, 2017 at 09:23:52AM +0100, Daniel Vetter wrote: > On Fri, Jan 20, 2017 at 09:46:17PM +0200, Ville Syrjälä wrote: > > On Tue, Jan 17, 2017 at 05:43:29PM +0100, Takashi Iwai wrote: > > > This is just a cleanup, no functional change. > > > > > > The fixup code for 1366x768 in drm_mode_create_from_cmdline_mode() is > > > basically a copy of the existing code in drm_edid.c. Make the latter > > > code public so that it can be called from the former function. > > > > > > Signed-off-by: Takashi Iwai > > > --- > > > v1->v2: Fix the wrong line removal of drm_mode_set_crtcinfo() call > > > > We prefer to include the changelog in the commit message proper. > > But it can be hoisted up easily enough when pushing. > > > > lgtm > > Reviewed-by: Ville Syrjälä > > Ville, can you pls also apply&push this to drm-misc.git? This would need a backmerge of the preceding fix into drm-misc-next. > > Thanks, Daniel > > > > > > > > drivers/gpu/drm/drm_crtc_internal.h | 3 +++ > > > drivers/gpu/drm/drm_edid.c | 6 +++--- > > > drivers/gpu/drm/drm_modes.c | 8 ++------ > > > 3 files changed, 8 insertions(+), 9 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h > > > index cdf6860c9d22..01bde7103ad6 100644 > > > --- a/drivers/gpu/drm/drm_crtc_internal.h > > > +++ b/drivers/gpu/drm/drm_crtc_internal.h > > > @@ -199,3 +199,6 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev, > > > void *data, struct drm_file *file_priv); > > > int drm_mode_page_flip_ioctl(struct drm_device *dev, > > > void *data, struct drm_file *file_priv); > > > + > > > +/* drm_edid.c */ > > > +void drm_mode_fixup_1366x768(struct drm_display_mode *mode); > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > > > index 336be31ff3de..739a19cb27d9 100644 > > > --- a/drivers/gpu/drm/drm_edid.c > > > +++ b/drivers/gpu/drm/drm_edid.c > > > @@ -2152,7 +2152,7 @@ drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid, > > > /* fix up 1366x768 mode from 1368x768; > > > * GFT/CVT can't express 1366 width which isn't dividable by 8 > > > */ > > > -static void fixup_mode_1366x768(struct drm_display_mode *mode) > > > +void drm_mode_fixup_1366x768(struct drm_display_mode *mode) > > > { > > > if (mode->hdisplay == 1368 && mode->vdisplay == 768) { > > > mode->hdisplay = 1366; > > > @@ -2176,7 +2176,7 @@ drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid, > > > if (!newmode) > > > return modes; > > > > > > - fixup_mode_1366x768(newmode); > > > + drm_mode_fixup_1366x768(newmode); > > > if (!mode_in_range(newmode, edid, timing) || > > > !valid_inferred_mode(connector, newmode)) { > > > drm_mode_destroy(dev, newmode); > > > @@ -2205,7 +2205,7 @@ drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid, > > > if (!newmode) > > > return modes; > > > > > > - fixup_mode_1366x768(newmode); > > > + drm_mode_fixup_1366x768(newmode); > > > if (!mode_in_range(newmode, edid, timing) || > > > !valid_inferred_mode(connector, newmode)) { > > > drm_mode_destroy(dev, newmode); > > > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c > > > index e6b19bc9021a..35bb993ebc39 100644 > > > --- a/drivers/gpu/drm/drm_modes.c > > > +++ b/drivers/gpu/drm/drm_modes.c > > > @@ -1461,12 +1461,8 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev, > > > > > > mode->type |= DRM_MODE_TYPE_USERDEF; > > > /* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ > > > - if (cmd->xres == 1366 && mode->hdisplay == 1368) { > > > - mode->hdisplay = 1366; > > > - mode->hsync_start--; > > > - mode->hsync_end--; > > > - drm_mode_set_name(mode); > > > - } > > > + if (cmd->xres == 1366) > > > + drm_mode_fixup_1366x768(mode); > > > drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); > > > return mode; > > > } > > > -- > > > 2.11.0 > > > > -- > > Ville Syrjälä > > Intel OTC > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Ville Syrjälä Intel OTC