From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 480F7C43613 for ; Mon, 24 Jun 2019 13:24:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A682212F5 for ; Mon, 24 Jun 2019 13:24:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZDzVNmz2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A682212F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1ChpvctprBrWzOD2UiuKSGqAFyom+rrw6Kt0t8f7nmU=; b=ZDzVNmz29TTitt DdAIzxdZc6tOgM8dfaV5eu+9ETodU+gWYT02XUH0Xy7xxWsuGH5GcFlOF+VI5Cp//mIeA2noerSP9 Q1tofPLb9Fz7vL+hRG945oernU4OE3R0mK6r/bNzKPHVHt86TWoJ9T/pVMgcS0t1upll5WEFtx8Mk TSLBgWV2dE8NQsUvSYq4xS8xOiqarhtT8xj8smkO/LbYHpyLwKY1jvTLRIuCAfO2Mm97y+T+qKb9A e0dSpdMHz6jrRbKtTa0/kXo7pbBB77U6tQe6yY26LZTxfM4ks3OpYfhhbfmSQJuv2GdSzfklknA3r 0+321atD9PjDY8xue89A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hfOxp-0007Ft-UA; Mon, 24 Jun 2019 13:24:54 +0000 Received: from mga18.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hfOxh-0007Di-Vq; Mon, 24 Jun 2019 13:24:47 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jun 2019 06:24:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,412,1557212400"; d="scan'208";a="163322976" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga007.fm.intel.com with SMTP; 24 Jun 2019 06:24:13 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 24 Jun 2019 16:24:13 +0300 Date: Mon, 24 Jun 2019 16:24:13 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Derek Basehore Subject: Re: [Intel-gfx] [PATCH v3 3/4] drm/connector: Split out orientation quirk detection Message-ID: <20190624132413.GN5942@intel.com> References: <20190622034105.188454-1-dbasehore@chromium.org> <20190622034105.188454-4-dbasehore@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190622034105.188454-4-dbasehore@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190624_062446_082395_FB17C5FD X-CRM114-Status: GOOD ( 23.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , CK Hu , linux-mediatek@lists.infradead.org, Philipp Zabel , Matthias Brugger , Sam Ravnborg , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 21, 2019 at 08:41:04PM -0700, Derek Basehore wrote: > Not every platform needs quirk detection for panel orientation, so > split the drm_connector_init_panel_orientation_property into two > functions. One for platforms without the need for quirks, and the > other for platforms that need quirks. > = > Signed-off-by: Derek Basehore > --- > drivers/gpu/drm/drm_connector.c | 45 ++++++++++++++++++++++++--------- > drivers/gpu/drm/i915/intel_dp.c | 4 +-- > drivers/gpu/drm/i915/vlv_dsi.c | 5 ++-- > include/drm/drm_connector.h | 2 ++ > 4 files changed, 39 insertions(+), 17 deletions(-) > = > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connec= tor.c > index e17586aaa80f..c4b01adf927a 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_prope= rty); > * drm_connector_init_panel_orientation_property - > * initialize the connecters panel_orientation property > * @connector: connector for which to init the panel-orientation propert= y. > - * @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_orient= ation > - * 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 =3D connector->dev; > struct drm_display_info *info =3D &connector->display_info; > struct drm_property *prop; > - int orientation_quirk; > - > - orientation_quirk =3D drm_get_panel_orientation_quirk(width, height); > - if (orientation_quirk !=3D DRM_MODE_PANEL_ORIENTATION_UNKNOWN) > - info->panel_orientation =3D orientation_quirk; > = > if (info->panel_orientation =3D=3D DRM_MODE_PANEL_ORIENTATION_UNKNOWN) > return 0; > @@ -1941,6 +1933,35 @@ int drm_connector_init_panel_orientation_property( > } > EXPORT_SYMBOL(drm_connector_init_panel_orientation_property); > = > +/** > + * drm_connector_init_panel_orientation_property_quirk - > + * initialize the connecters panel_orientation property with a quirk > + * override > + * @connector: connector for which to init the panel-orientation propert= y. > + * @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 will check for platform specific (e.g. DMI based) quirks > + * overriding display_info.panel_orientation first, then if panel_orient= ation > + * is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN 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_quirk( > + struct drm_connector *connector, int width, int height) > +{ > + int orientation_quirk; > + > + orientation_quirk =3D drm_get_panel_orientation_quirk(width, height); > + if (orientation_quirk !=3D DRM_MODE_PANEL_ORIENTATION_UNKNOWN) > + connector->display_info.panel_orientation =3D orientation_quirk; > + > + return drm_connector_init_panel_orientation_property(connector); > +} > +EXPORT_SYMBOL(drm_connector_init_panel_orientation_property_quirk); > + > int drm_connector_set_obj_prop(struct drm_mode_object *obj, > struct drm_property *property, > uint64_t value) > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel= _dp.c > index b099a9dc28fd..7d4e61cf5463 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -7282,8 +7282,8 @@ static bool intel_edp_init_connector(struct intel_d= p *intel_dp, > intel_panel_setup_backlight(connector, pipe); > = > if (fixed_mode) > - drm_connector_init_panel_orientation_property( > - connector, fixed_mode->hdisplay, fixed_mode->vdisplay); > + drm_connector_init_panel_orientation_property_quirk(connector, > + fixed_mode->hdisplay, fixed_mode->vdisplay); > = > return true; > = > diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_ds= i.c > index bfe2891eac37..fa9833dbe359 100644 > --- a/drivers/gpu/drm/i915/vlv_dsi.c > +++ b/drivers/gpu/drm/i915/vlv_dsi.c > @@ -1650,6 +1650,7 @@ static void intel_dsi_add_properties(struct intel_c= onnector *connector) > = > if (connector->panel.fixed_mode) { > u32 allowed_scalers; > + int orientation; > = > allowed_scalers =3D BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FU= LLSCREEN); > if (!HAS_GMCH(dev_priv)) > @@ -1660,9 +1661,7 @@ static void intel_dsi_add_properties(struct intel_c= onnector *connector) > = > connector->base.state->scaling_mode =3D DRM_MODE_SCALE_ASPECT; > = > - connector->base.display_info.panel_orientation =3D > - vlv_dsi_get_panel_orientation(connector); Where did that go? > - drm_connector_init_panel_orientation_property( > + drm_connector_init_panel_orientation_property_quirk( > &connector->base, > connector->panel.fixed_mode->hdisplay, > connector->panel.fixed_mode->vdisplay); > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h > index 47e749b74e5f..0468fd9a4418 100644 > --- a/include/drm/drm_connector.h > +++ b/include/drm/drm_connector.h > @@ -1370,6 +1370,8 @@ 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 drm_connector_init_panel_orientation_property_quirk( > struct drm_connector *connector, int width, int height); > int drm_connector_attach_max_bpc_property(struct drm_connector *connecto= r, > int min, int max); > -- = > 2.22.0.410.gd8fdbe21b5-goog > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Ville Syrj=E4l=E4 Intel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel