From patchwork Tue Feb 6 16:56:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10203483 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 04D8860247 for ; Tue, 6 Feb 2018 16:56:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D574D28173 for ; Tue, 6 Feb 2018 16:56:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9E3E288ED; Tue, 6 Feb 2018 16:56:46 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 71EDC2868D for ; Tue, 6 Feb 2018 16:56:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D3C289F82; Tue, 6 Feb 2018 16:56:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E8AB89F82 for ; Tue, 6 Feb 2018 16:56:43 +0000 (UTC) Received: by mail-yw0-x243.google.com with SMTP id b129so1793836ywa.8 for ; Tue, 06 Feb 2018 08:56:43 -0800 (PST) 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=tQPSfmKivwRlTrBHm7LI7zRsK2UPOJiZlHQkLi6GUrE=; b=Jw4lllcNv0SD/UcK8kcBWg/JDeRxsCx2AaCiFXm19EzNdu7LKJ893Xsp/PTcNrEhqy szeAsr9lAJjBs2qA/6N7XsiIbTsHHInaPRHK088yfs4kFTeILpeml5xveFvhtnpIssj6 x267IhD/M9j+yxBEN/wmlXc4ageV/lkPdnmNY= 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=tQPSfmKivwRlTrBHm7LI7zRsK2UPOJiZlHQkLi6GUrE=; b=gZzl5dnplz2m4+l0uw5ghnCvwHweyZw1uGMGXxAA23kivhXoamTuKJCPnarjvlmMoP PujUcTarUtUJJRGTHwcpFADC6jPGoOm4amemtBlilW+fhwuIUEj2OxG+w9Y4l/tyGgiY rpw+r4cRY7F8j8wcliq/4dbq6pofiidsfLy2OWUgu0HCQS14qjdVjGIAgeAjJuy3d6gq qXX6AXnExhOGkHA6gIaqEKefOnC8u764aCGeakTf3LI0fG4gUGCFopwgcBjtdf47rQhI i+I3lrBuAXPTvIjuc/RH2puz1IwnNfYAa2Uh6SaCDOjW/EgM3cC4Ax8hCXfA0a1wRyIR OKsA== X-Gm-Message-State: APf1xPBSS9K9+AVqq/HRNNNp7JNAKnC/UcA1xG8pS0NXg8uuqqq+6ItX whiiRJ8YglpTg3d6+FeMr4uq2ciI2ms= X-Google-Smtp-Source: AH8x226RcsYekRM9koPfpPHQSsnZOQkeeAOfFjTHY32WxNalemeYC9rRdMite2WeobVuyucQ090rMQ== X-Received: by 10.37.65.17 with SMTP id o17mr1235432yba.485.1517936202463; Tue, 06 Feb 2018 08:56:42 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:d3af:69ac:1964:28e8]) by smtp.gmail.com with ESMTPSA id z77sm4004805ywd.21.2018.02.06.08.56.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 08:56:41 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 1/3] drm/panel: simple: Add ability to override typical timing Date: Tue, 6 Feb 2018 11:56:20 -0500 Message-Id: <20180206165626.37692-2-seanpaul@chromium.org> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog In-Reply-To: <20180206165626.37692-1-seanpaul@chromium.org> References: <20180206165626.37692-1-seanpaul@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thierry Reding , Mark Rutland , Jeffy Chen , Doug Anderson , Rob Herring , =?UTF-8?q?St=C3=A9phane=20Marchesin?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the ability to override the typical display timing for a given panel. This is useful for devices which have timing constraints that do not apply across the entire display driver (eg: to avoid crosstalk between panel and digitizer on certain laptops). The rules are as follows: - panel must not specify fixed mode (since the override mode will either be the same as the fixed mode, or we'll be unable to check the bounds of the overried) - panel must specify at least one display_timing range which will be used to ensure the override mode fits within its bounds Cc: Doug Anderson Cc: Heiko Stuebner Cc: Jeffy Chen Cc: Rob Herring Cc: Stéphane Marchesin Cc: Thierry Reding Cc: devicetree@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Sean Paul --- .../bindings/display/panel/simple-panel.txt | 20 +++++++ drivers/gpu/drm/panel/panel-simple.c | 69 +++++++++++++++++++++- 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/panel/simple-panel.txt b/Documentation/devicetree/bindings/display/panel/simple-panel.txt index 16d8ff088b7d..590bbff6fc90 100644 --- a/Documentation/devicetree/bindings/display/panel/simple-panel.txt +++ b/Documentation/devicetree/bindings/display/panel/simple-panel.txt @@ -7,6 +7,14 @@ Optional properties: - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing - enable-gpios: GPIO pin to enable or disable the panel - backlight: phandle of the backlight device attached to the panel +- override-mode: For devices which require a mode which differs from the + display_timing's "typical" mode, and whose restrictions cannot + be applied across the entire platform. The mode must fall + within the bounds of the panel's specified display_timing, and + cannot be used if the panel already specifies a single fixed + mode. The format is specified under "timing subnode" in + display-timing.txt + Example: @@ -18,4 +26,16 @@ Example: enable-gpios = <&gpio 90 0>; backlight = <&backlight>; + + override-mode { + clock-frequency = <266604720>; + hactive = <2400>; + hfront-porch = <48>; + hback-porch = <84>; + hsync-len = <32>; + vactive = <1600>; + vfront-porch = <3>; + vback-porch = <120>; + vsync-len = <10>; + } }; diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 5591984a392b..b774365f3635 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -34,6 +34,7 @@ #include #include