From patchwork Fri Sep 8 11:54:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9943775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F1C5604D5 for ; Fri, 8 Sep 2017 11:54:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F64128617 for ; Fri, 8 Sep 2017 11:54:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53819286B3; Fri, 8 Sep 2017 11:54:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 069E028617 for ; Fri, 8 Sep 2017 11:54:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753407AbdIHLyy (ORCPT ); Fri, 8 Sep 2017 07:54:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53988 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752245AbdIHLyy (ORCPT ); Fri, 8 Sep 2017 07:54:54 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0AAF8267C2; Fri, 8 Sep 2017 11:54:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0AAF8267C2 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=hdegoede@redhat.com Received: from shalem.localdomain.com (ovpn-117-44.ams2.redhat.com [10.36.117.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 544325D97C; Fri, 8 Sep 2017 11:54:52 +0000 (UTC) From: Hans de Goede To: Daniel Vetter , Jani Nikula , Sean Paul , David Airlie , Bartlomiej Zolnierkiewicz Cc: Hans de Goede , Bastien Nocera , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH 3/3] drm/i915: Add "panel orientation" property to the panel connector Date: Fri, 8 Sep 2017 13:54:44 +0200 Message-Id: <20170908115444.19122-4-hdegoede@redhat.com> In-Reply-To: <20170908115444.19122-1-hdegoede@redhat.com> References: <20170908115444.19122-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 08 Sep 2017 11:54:54 +0000 (UTC) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For now this is always set to DRM_MODE_PANEL_ORIENTATION_UNKNOWN unless there is a dmi based quirk overriding the value. In the future we should probably provide an initial value based on the VBT (at least for some panel types). Signed-off-by: Hans de Goede --- drivers/gpu/drm/i915/intel_panel.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 72f8cbb237b1..4a52c9d5790a 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -1926,6 +1926,22 @@ int intel_panel_init(struct intel_panel *panel, struct drm_display_mode *alt_fixed_mode, struct drm_display_mode *downclock_mode) { + struct intel_connector *intel_connector = + container_of(panel, struct intel_connector, panel); + int ret; + + if (fixed_mode) { + ret = drm_connector_create_panel_orientation_property( + intel_connector->base.dev); + if (ret) + return ret; + + drm_connector_attach_panel_orientation_property( + &intel_connector->base, + fixed_mode->hdisplay, fixed_mode->vdisplay, + DRM_MODE_PANEL_ORIENTATION_UNKNOWN); + } + intel_panel_init_backlight_funcs(panel); panel->fixed_mode = fixed_mode;