Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3800611ybi; Mon, 10 Jun 2019 17:25:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrI4N/uZjG6Iz/PYq1ozjfQYgMNJd0GOEqtC3sQhnhBQSyPrVkuiGyZdr0jxdAY9gvJsYx X-Received: by 2002:a63:2349:: with SMTP id u9mr9565863pgm.410.1560212722325; Mon, 10 Jun 2019 17:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560212722; cv=none; d=google.com; s=arc-20160816; b=mJ56vtPXiZfflYYI8AgH4rH3/BIxlRXWgJSZLM9ZiKiqt8aXow/w0c7qYgpIuEzwtS 6DNuKivSWb59bUpy5tco7A7hWMyp72WAV1tg6cCx+JYj5TG4yUr4fhHWKBV7ntIi7AXa NtogLlj3jYIpx9AQcVAYDot43+UgegrUypWeaAM/JhX8Vh1P8VGObpy0T/xxvbMOtxKk Bhshs4L/liMCXavTHZtwUE73rVbg8ZskcvTShBkvPDR/Fby/QOadE3kuEMiSRdawdJTd vHu85B0VcUs93NAEiw75VCXg4U3oataq4TcSaQRd1MGglWPK06QdX+P+R7Cquhoztv+3 VbqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SbGlBPyajmgb9CaueSzIfrgJlhnAGN7+8e2UjE2WPGs=; b=lygW0lbHTy6D0vqIsAGRU0weqt0LZJUWi0GQwbYxqoRzhbcNKAZbvkKJG0ShyIN+vx ajpliuPsWghcYjvEahNp7zOPM46hBsYQNL8qInwH2nnZFdBJiSnLvT9Vfsc78y2WOa10 FPaQKLBuc11WgJ555FxxZTsbN4vdIKfZEnmxjdTg0n5wJFUrM0aAr9kWX+yZwi820/l5 mgx3WVxmukiqznynaLEGjatJ9S9zDhCvm8o5oqls7z0FWkiJl/UKZbkS+EmDAQbHkxvA mLnBJ2DF8WpU776xbCKlk0tLXxsq6ksOznu8X7vEphXsohZ584YqrrtnT0k2ykxutpHH AnyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="QMTcan/t"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si11284481pfh.232.2019.06.10.17.25.07; Mon, 10 Jun 2019 17:25:22 -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; dkim=pass header.i=@chromium.org header.s=google header.b="QMTcan/t"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390856AbfFKAXM (ORCPT + 99 others); Mon, 10 Jun 2019 20:23:12 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41605 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390787AbfFKAXL (ORCPT ); Mon, 10 Jun 2019 20:23:11 -0400 Received: by mail-pf1-f193.google.com with SMTP id m30so5724278pff.8 for ; Mon, 10 Jun 2019 17:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SbGlBPyajmgb9CaueSzIfrgJlhnAGN7+8e2UjE2WPGs=; b=QMTcan/tAguair4X5N96kBUhDCQmzcPQ8o33atawGY8VZu4nSq4tzlWDtJGd+W/JpQ nl1W7EVIj+azFgH5SC++A+b3c6obUjjID0u/wvWW7dT4ASZmLXG0PkwC7/eoU1mQCkOK myUpXIrOD1SQJe+dlbHElyIEz85++rjSgwYnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SbGlBPyajmgb9CaueSzIfrgJlhnAGN7+8e2UjE2WPGs=; b=WzE4GLRIkgaKTYl+I4ZM65x49EXhbKc1TV09MvmEuPraegIgAYdIJ/h2duWD4Kl60L 4/wbSYAm5zjKXmzgVjyoVbpTgw+SsGiF13BpHceysqDziCqh/aqcyucFm03Qc4NTGFwf BhSS0NgcD1tZjmZHJuukPh0l8jUWx4XJSt6lMPiAC8WP5ZukgV7wWA877e4WRG1XXJde WTPuJnOqIEASUaWPvcT01pySQxfWMTwMbEc0v99Kv5VYGbrar/yAjwa0b5mXXW1bIxkl GurK/Ti9XgGu7Ba5om3DVcY3wqMrM4Yhxm/VNxixC7oPmcWBE90vCF/2rPuJUKrh9eIL /gfw== X-Gm-Message-State: APjAAAVk8wqWeThCEcUTqE/0jRbHMl18Wg+5fP4RiZZWKgY0FJi9GqeM hSKjm/5NAFj+o/aXeR0dHXuGOM0Ku5U= X-Received: by 2002:a63:ee12:: with SMTP id e18mr18316371pgi.412.1560212589668; Mon, 10 Jun 2019 17:23:09 -0700 (PDT) Received: from exogeni.mtv.corp.google.com ([2620:15c:202:1:5be8:f2a6:fd7b:7459]) by smtp.gmail.com with ESMTPSA id t4sm540317pjq.19.2019.06.10.17.23.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 10 Jun 2019 17:23:09 -0700 (PDT) From: Derek Basehore To: linux-kernel@vger.kernel.org Cc: maarten.lankhorst@linux.intel.com, maxime.ripard@bootlin.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, thierry.reding@gmail.com, sam@ravnborg.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, ck.hu@mediatek.com, p.zabel@pengutronix.de, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Derek Basehore Subject: [PATCH 4/5] drm/connector: Split out orientation quirk detection Date: Mon, 10 Jun 2019 17:22:55 -0700 Message-Id: <20190611002256.186969-5-dbasehore@chromium.org> X-Mailer: git-send-email 2.22.0.rc2.383.gf4fbbf30c2-goog In-Reply-To: <20190611002256.186969-1-dbasehore@chromium.org> References: <20190611002256.186969-1-dbasehore@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 device tree systems where quirk detection like this is not needed. Signed-off-by: Derek Basehore --- drivers/gpu/drm/drm_connector.c | 16 ++++------------ drivers/gpu/drm/i915/vlv_dsi.c | 13 +++++++++---- include/drm/drm_connector.h | 2 +- 3 files changed, 14 insertions(+), 17 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/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c index bfe2891eac37..113129996530 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_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 +1661,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->display_info.panel_orientation = orientation; + else + connector->display_info.panel_orientation = + intel_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); -- 2.22.0.rc2.383.gf4fbbf30c2-goog