Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4127978ybi; Tue, 11 Jun 2019 01:13:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqztNME36DAaGtjMaZohqR23rkqI42LeGuI/pRP5Pn/kdScqzp6Mj7F7AL3SjlCRCi2Sm5NA X-Received: by 2002:a63:d103:: with SMTP id k3mr1805406pgg.189.1560240806212; Tue, 11 Jun 2019 01:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560240806; cv=none; d=google.com; s=arc-20160816; b=Uw42JI/fh8SEEUHWWwryKGZN+QQM5/5sK3y+2qzZlPwWDy2n9jHjwki7zJmAx9kHf6 ya4huoA2Sztx2FJBpK7FdC/E0pPOgs4+SYUiadWlPgVfVVig9gLfKRo1Z2xUL6feZCTc tLSFUBf8YSrzOvb95VmFMKeKh3B4zZEespiVtdNgBW2E+ujKZswTrETd/15NYNHnVaBN 9O9lFBmwtChQuA9e9U1L3XnITOq2SRXdJbOnL9Y06IoxhnYRnaswpGVQ7xQ+mRJq2XyC pS9vGQD1X4Wmip6rfRBk9xSBSQGW+8hgHI1eKLadMRBKe6HYHmiHZAaMvuAYG8jvSKng isAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=3rK3nPLG93tvQPr6m07OVs2A8Bxrfq0XE9WVHhzBV6g=; b=TwtrFJH8WMOquHORKFOt0yONNrOR0QmZEE8YL9SPx4NjIgwAd8clRn61FVaiamZxnq OF+U6J0crO5LMVFTZWsCq0XEJJXE/XYZj24PSUQJ3CbiM0TdtoQh55GqnSn5oXBKw2/K EeY+f0GB+fjHo8JpclDzfzT3QKLs6hu5AQX1o/zkY0LEER16iEWJmKh56Siw3HB6YQQW qyc1J2ojsZdOA+XxJ60za7dWIKqlExUx1b6Cny1mu8akEDrU+MWQL4ARaAcq0hq+S2mo FJii90lJibV0biUNbkwjVcKg5adFEp2Z0SJKixcrE52OD1TxBTiZDZuusAkcUXaJug+0 H+WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si1987168pjg.50.2019.06.11.01.13.09; Tue, 11 Jun 2019 01:13:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404569AbfFKIFJ (ORCPT + 99 others); Tue, 11 Jun 2019 04:05:09 -0400 Received: from mga02.intel.com ([134.134.136.20]:33802 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404389AbfFKIFJ (ORCPT ); Tue, 11 Jun 2019 04:05:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2019 01:05:08 -0700 X-ExtLoop1: 1 Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.150]) by fmsmga001.fm.intel.com with ESMTP; 11 Jun 2019 01:05:02 -0700 From: Jani Nikula To: Derek Basehore , linux-kernel@vger.kernel.org Cc: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Maarten Lankhorst , Maxime Ripard , Sean Paul , Joonas Lahtinen , Rodrigo Vivi , CK Hu , Philipp Zabel , Matthias Brugger , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Derek Basehore , Hans de Goede , Ville =?utf-8?B?U3lyasOkbMOk?= Subject: Re: [PATCH 4/5] drm/connector: Split out orientation quirk detection In-Reply-To: <20190611040350.90064-5-dbasehore@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20190611040350.90064-1-dbasehore@chromium.org> <20190611040350.90064-5-dbasehore@chromium.org> Date: Tue, 11 Jun 2019 11:08:03 +0300 Message-ID: <87zhmoy270.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jun 2019, Derek Basehore wrote: > This removes the orientation quirk detection from the code to add > an orientation property to a panel. This is used only for legacy x86 > systems, yet we'd like to start using this on devicetree systems where > quirk detection like this is not needed. Not needed, but no harm done either, right? I guess I'll defer judgement on this to Hans and Ville (Cc'd). Side note, I'm about to apply some (minor) conflicting changes in our -next as soon as I get CI results on it. BR, Jani. > > Signed-off-by: Derek Basehore > --- > drivers/gpu/drm/drm_connector.c | 16 ++++------------ > drivers/gpu/drm/i915/intel_dp.c | 14 +++++++++++--- > drivers/gpu/drm/i915/vlv_dsi.c | 14 ++++++++++---- > include/drm/drm_connector.h | 2 +- > 4 files changed, 26 insertions(+), 20 deletions(-) > > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c > index e17586aaa80f..58a09b65028b 100644 > --- a/drivers/gpu/drm/drm_connector.c > +++ b/drivers/gpu/drm/drm_connector.c > @@ -1894,31 +1894,23 @@ EXPORT_SYMBOL(drm_connector_set_vrr_capable_property); > * drm_connector_init_panel_orientation_property - > * initialize the connecters panel_orientation property > * @connector: connector for which to init the panel-orientation property. > - * @width: width in pixels of the panel, used for panel quirk detection > - * @height: height in pixels of the panel, used for panel quirk detection > * > * This function should only be called for built-in panels, after setting > * connector->display_info.panel_orientation first (if known). > * > - * This function will check for platform specific (e.g. DMI based) quirks > - * overriding display_info.panel_orientation first, then if panel_orientation > - * is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN it will attach the > - * "panel orientation" property to the connector. > + * This function will check if the panel_orientation is not > + * DRM_MODE_PANEL_ORIENTATION_UNKNOWN. If not, it will attach the "panel > + * orientation" property to the connector. > * > * Returns: > * Zero on success, negative errno on failure. > */ > int drm_connector_init_panel_orientation_property( > - struct drm_connector *connector, int width, int height) > + struct drm_connector *connector) > { > struct drm_device *dev = connector->dev; > struct drm_display_info *info = &connector->display_info; > struct drm_property *prop; > - int orientation_quirk; > - > - orientation_quirk = drm_get_panel_orientation_quirk(width, height); > - if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) > - info->panel_orientation = orientation_quirk; > > if (info->panel_orientation == DRM_MODE_PANEL_ORIENTATION_UNKNOWN) > return 0; > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index b099a9dc28fd..72ab090ea97a 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -40,6 +40,7 @@ > #include > #include > #include > +#include > #include > > #include "i915_debugfs.h" > @@ -7281,9 +7282,16 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, > intel_connector->panel.backlight.power = intel_edp_backlight_power; > intel_panel_setup_backlight(connector, pipe); > > - if (fixed_mode) > - drm_connector_init_panel_orientation_property( > - connector, fixed_mode->hdisplay, fixed_mode->vdisplay); > + if (fixed_mode) { > + int orientation = drm_get_panel_orientation_quirk( > + fixed_mode->hdisplay, fixed_mode->vdisplay); > + > + if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) > + connector->display_info.panel_orientation = > + orientation; > + > + drm_connector_init_panel_orientation_property(connector); > + } > > return true; > > diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c > index bfe2891eac37..27f86a787f60 100644 > --- a/drivers/gpu/drm/i915/vlv_dsi.c > +++ b/drivers/gpu/drm/i915/vlv_dsi.c > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include > > #include "i915_drv.h" > #include "intel_atomic.h" > @@ -1650,6 +1651,7 @@ static void intel_dsi_add_properties(struct intel_connector *connector) > > if (connector->panel.fixed_mode) { > u32 allowed_scalers; > + int orientation; > > allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN); > if (!HAS_GMCH(dev_priv)) > @@ -1660,12 +1662,16 @@ static void intel_dsi_add_properties(struct intel_connector *connector) > > connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT; > > - connector->base.display_info.panel_orientation = > - vlv_dsi_get_panel_orientation(connector); > - drm_connector_init_panel_orientation_property( > - &connector->base, > + orientation = drm_get_panel_orientation_quirk( > connector->panel.fixed_mode->hdisplay, > connector->panel.fixed_mode->vdisplay); > + if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) > + connector->base.display_info.panel_orientation = orientation; > + else > + connector->base.display_info.panel_orientation = > + vlv_dsi_get_panel_orientation(connector); > + > + drm_connector_init_panel_orientation_property(&connector->base); > } > } > > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h > index 47e749b74e5f..c2992f7a0dd5 100644 > --- a/include/drm/drm_connector.h > +++ b/include/drm/drm_connector.h > @@ -1370,7 +1370,7 @@ void drm_connector_set_link_status_property(struct drm_connector *connector, > void drm_connector_set_vrr_capable_property( > struct drm_connector *connector, bool capable); > int drm_connector_init_panel_orientation_property( > - struct drm_connector *connector, int width, int height); > + struct drm_connector *connector); > int drm_connector_attach_max_bpc_property(struct drm_connector *connector, > int min, int max); -- Jani Nikula, Intel Open Source Graphics Center