From patchwork Thu Jul 11 20:34:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 11040761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE74D14C0 for ; Thu, 11 Jul 2019 20:45:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD6DF288AA for ; Thu, 11 Jul 2019 20:45:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B19EA28B1F; Thu, 11 Jul 2019 20:45:11 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D3D4288AA for ; Thu, 11 Jul 2019 20:45:11 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VHhDcFXbwKBUapB4L81buON1OO9vDgmCiRF+p+dlXDU=; b=VdnNcb9A6LrVBW e/05nxD2zWyxdu72lQxALBgmteyz1ouNDSk2xFneUbt4WAlcsQ+iqjTOh5POqZdEAZXikGc1Ov7aC IFUMYPSVQBgCEzwrAvLU9Q3JF4r3f44dWDubSDcVg70L/mgAQHljyAyBDhRWiThxBzj30AKF/Ibve U8Ocl2Vp0weKME19g2wdlOaZXfG5ABf/+9yKGYX47ypsgM9cQufnAd927Bl/3pXmSgmmIvnhdJLpJ 8MDYm+mDzUCaQeAg/T0ClmzmtU6RXyS23MUXVfMzhs5TdOLSv5F3NXoJsUAw82bGTFmjKAntMagPx NQVi2lnryOpJ5tSd5vwA==; 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 1hlfwA-0007Wz-Vl; Thu, 11 Jul 2019 20:45:06 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hlfw6-0006uU-0G for linux-rockchip@lists.infradead.org; Thu, 11 Jul 2019 20:45:03 +0000 Received: by mail-pf1-x443.google.com with SMTP id t16so3281381pfe.11 for ; Thu, 11 Jul 2019 13:45:01 -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=aElOUa28IDV+Ms9r3bfrgzJICeP4nyAIWqfUYkJpGGU=; b=KfICzL+zhG+iFMQSO5h96qlDv0Q4R/M/HLlUjjPtDF9xvFcNiGBvMnMsRpT42iQc5+ VS+bdk6ElH393b/7aREvh0oD+MbpUJc8/K8fBwW0gyrE4dwHL9SJyrTnP8s6ZkA7Fozg oeo+8/OoXqIFNmDvQ3vDWDTuEVHa3i+PzTU9M= 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=aElOUa28IDV+Ms9r3bfrgzJICeP4nyAIWqfUYkJpGGU=; b=eAHJ8BUqRm8PXbBRkwRSxhKckNJMc2UE6xo+TAQMPAptUuADXyDVPzR/MtsaRLH6od Sh+Rxzqnwxw1BgYhhJO8cIozxHRbKWUVsRzmCWByuU4wQiQkGqZmJS4Zolh4mKeFPgrH EilDblTztn3rbBBdhu0XiFs16OcOFeTgQW0tpOrpjZJaqmS7ygI1fAgI1uvEY/Bg+GdN ocBcRzxq5+6RxwGldR9bLP2ZWN+e60BW0mhUJ/lpQQl6GN7oZ7m8yBKnTjc31FuPz7oP WanrkN31KwsKjtvOQyBMtf9wvuAnxRGKkhq1rx6wnh1fyjwfgrrO5sME4CzBHmvmkb6k pDvg== X-Gm-Message-State: APjAAAUNoldXDP+O9tIWqblvIaWnkoE/xyWi+mP0ahTETGP53Jwme5fa dhB5XnLPqxbBlWwu+GX64m49Zw== X-Google-Smtp-Source: APXvYqxWtmbfQ6xXRJMgZcr6q9t9MQEgBglf68LAJcm3jnErkAO8JgOtdlvX+3xb7vGMLCQ/B1BfZQ== X-Received: by 2002:a63:e010:: with SMTP id e16mr2005549pgh.285.1562877901085; Thu, 11 Jul 2019 13:45:01 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id f17sm5320110pgv.16.2019.07.11.13.45.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 11 Jul 2019 13:45:00 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Heiko Stuebner , Sean Paul Subject: [PATCH v6 1/3] drm/panel: simple: Add ability to override typical timing Date: Thu, 11 Jul 2019 13:34:53 -0700 Message-Id: <20190711203455.125667-2-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190711203455.125667-1-dianders@chromium.org> References: <20190711203455.125667-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190711_134502_055396_56CD9361 X-CRM114-Status: GOOD ( 20.96 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rob Herring , Eric Anholt , David Airlie , Sam Ravnborg , Jeffy Chen , Doug Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Boris Brezillon , Laurent Pinchart , Daniel Vetter , Enric Balletbo i Serra , =?utf-8?q?St=C3=A9ph?= =?utf-8?q?ane_Marchesin?= , Ezequiel Garcia , mka@chromium.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul 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 Changes in v2: - Parse the full display-timings node (using the native-mode) (Rob) Changes in v3: - No longer parse display-timings subnode, use panel-timing (Rob) Changes in v4: - Don't add mode from timing if override was specified (Thierry) - Add warning if timing and fixed mode was specified (Thierry) - Don't add fixed mode if timing was specified (Thierry) - Refactor/rename a bit to avoid extra indentation from "if" tests - i should be unsigned (Thierry) - Add annoying WARN_ONs for some cases (Thierry) - Simplify 'No display_timing found' handling (Thierry) - Rename to panel_simple_parse_override_mode() (Thierry) Changes in v5: - Added Heiko's Tested-by Changes in v6: - Rebased to drm-misc next - Added tags Cc: Doug Anderson Cc: Eric Anholt 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 Signed-off-by: Sean Paul Tested-by: Enric Balletbo i Serra Signed-off-by: Douglas Anderson Tested-by: Heiko Stuebner Reviewed-by: Boris Brezillon Acked-by: Thierry Reding --- drivers/gpu/drm/panel/panel-simple.c | 109 +++++++++++++++++++++++++-- 1 file changed, 104 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index af6bf5611b4e..1bee197821ef 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -30,6 +30,7 @@ #include #include