Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp989649pxb; Tue, 14 Sep 2021 13:24:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2qmYsdS06jkAq2SyPcFz2a2OUkIVdpFhNod5YV7vUdM7ZiegymtLFawqOw843kLjDfrsl X-Received: by 2002:a05:6e02:152b:: with SMTP id i11mr2937741ilu.65.1631651060761; Tue, 14 Sep 2021 13:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631651060; cv=none; d=google.com; s=arc-20160816; b=WEypoe1QyrFgCoBkf/tyzPZ6F/2KPyVeyFTOqPWe8DIBUPYbzMbENqwf7uAn7DQV5G EwIDWT1PV++WGMW2emT4RuZ6WWoxRw2flaYsT/fMbN/1Uss0t+VE4Wp52Kyd+qQQoIhw qKpRpOVOIt1QEFOFyC6zHCNEHWWUpJz46pF4Tat3MKjYJnggPF1DMQBc5NlrxtElBjU2 uvMmChTCyQeyIwj8T4v9OxMMn9v96yaJUtv2r8C3jTK9xr0m7C2cNqYck1z3WVj6RdsJ LkOi/akhZHk4sbryTpuOxXHg4NepPZ3lfiB8X1OKLxZQIB3aIeOEW2bWuDW7mVC626OU bW8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0nAj1TelyJmSaF4TMY4AbANDSnLkT0dFj5LXHDQg3Ys=; b=zMy9AKt5/G+xoChg6Fi6hn18ciLht8pIGIMC2LJEy26c1Kc2FKkvTHeqdtPfA1PZ1M PtTumoUfExlfzze9XzIuN9S543I+W2A4+zrXhY0Laoy+PZkWRMmQuRa1vrioGzuu7w9u PjerDdx4qEqxD/sDYiP1TVLIx3rk0E6rr8Q0lHJcKmtZS8RMoveco2UbRUW1tH9u2a2v 5TkxgFJzmMI0j+zFHNUo8/86ZCzekhhuO3bXCftJcOgVeegFrNRGFYKKFKvGHfGfqXpr +dahy3I4FdlX9Gn44Nt6WXjYe1lRY9DJSfIR42uDKB5UWjA92Ew5aQXOjTomN3iQRoJ9 fvTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dF+lwG1X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v18si12465013ilc.7.2021.09.14.13.24.09; Tue, 14 Sep 2021 13:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dF+lwG1X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234233AbhINUYF (ORCPT + 99 others); Tue, 14 Sep 2021 16:24:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234029AbhINUXu (ORCPT ); Tue, 14 Sep 2021 16:23:50 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68278C061767 for ; Tue, 14 Sep 2021 13:22:32 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id w19-20020a17090aaf9300b00191e6d10a19so534616pjq.1 for ; Tue, 14 Sep 2021 13:22:32 -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=0nAj1TelyJmSaF4TMY4AbANDSnLkT0dFj5LXHDQg3Ys=; b=dF+lwG1XH8BqSXrkMnBSyJBFNCujUPK52qzlX33pfMk3KFVEFZSCy3YwxKXlC9YyXh /FWEgMOcQcjSOSVRizEbX4igxs2cpO2y0kxzLsKwq5Mm9on/8fLzP1ehP3RJq5zEHIhO aQIugJBaKXengbn8v0u+1m1MCcWmHTlWQzwSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0nAj1TelyJmSaF4TMY4AbANDSnLkT0dFj5LXHDQg3Ys=; b=VK+FKoKD/pGp0o5Iec+UePRGZ0Un+bJncDSqGn4PJORQtrZ5K39VvWhuuHp6bCs0Nn HK1dJD8d2JpTEs1rQetaflOvTPY/BStQjCGV7CJARWKKOqCMKvd0LYScq3MkGjDSdEwZ zXvncq3kGfYsLKN39kbCJC+BSExlInUXHH0aZ9hrfrvZtWZTJwKiroLgt452KDeE0LAf 8QABwpxPDaVFpoJh1kznef74cWCImsvsKWUv0zOLTnYW0ddC6EN+wn3/EEs4lz/CKTcp rf5wxUVE0/5yrl5mfXS4QQXMkZSSCVKGLHKSWRJvspujxkiVvSD6XHaaqwDQrfFdzPJx ZfKw== X-Gm-Message-State: AOAM530oScH32SWIV2cmxlNqtQfR3Up/vFScA0xm6LePSuQS5m2q9ZxB YNzKdnQe9UODcUZSlhG7IRmQnamkMe54YA== X-Received: by 2002:a17:902:da88:b0:13b:76f3:5263 with SMTP id j8-20020a170902da8800b0013b76f35263mr16538893plx.47.1631650951583; Tue, 14 Sep 2021 13:22:31 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:f38f:9d0f:3eba:f8c4]) by smtp.gmail.com with ESMTPSA id 141sm12185393pgg.16.2021.09.14.13.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 13:22:31 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Rob Herring , Sam Ravnborg Cc: devicetree@vger.kernel.org, Steev Klimaszewski , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, David Airlie , Maarten Lankhorst , Thomas Zimmermann , Linus W , Bjorn Andersson , Daniel Vetter , Maxime Ripard , Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH v5 07/15] drm/panel-edp: Split eDP panels out of panel-simple Date: Tue, 14 Sep 2021 13:21:54 -0700 Message-Id: <20210914132020.v5.7.I0a2f75bb822d17ce06f5b147734764eeb0c3e3df@changeid> X-Mailer: git-send-email 2.33.0.309.g3052b89438-goog In-Reply-To: <20210914202202.1702601-1-dianders@chromium.org> References: <20210914202202.1702601-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The panel-simple driver handles way too much. Let's start trying to get a handle on it by splitting out the eDP panels. This patch does this: 1. Start by copying simple-panel verbatim over to a new driver, simple-panel-edp. 2. Rename "panel_simple" to "panel_edp" in the new driver. 3. Keep only panels marked with `DRM_MODE_CONNECTOR_eDP` in the new driver. Remove those panels from the old driver. 4. Remove all recent "DP AUX bus" stuff from the old driver. The DP AUX bus is only possible on DP panels. 5. Remove all DSI / MIPI related functions from the new driver. 6. Remove bus_format / bus_flags from eDP driver. These things don't seem to make any sense for eDP panels so let's stop filling in made up stuff. In the end we end up with a bunch of duplicated code for now. Future patches will try to address _some_ of this duplicated code though some of it will be unavoidable. NOTE: This may not actually move all eDP panels over to the new driver since not all panels were properly marked with `DRM_MODE_CONNECTOR_eDP`. A future patch will attempt to move wayward panels I could identify but even so there may be some missed. Suggested-by: Sam Ravnborg Signed-off-by: Douglas Anderson Acked-by: Sam Ravnborg --- (no changes since v4) Changes in v4: - PANEL_SIMPLE_EDP => PANEL_EDP - Remove "non-eDP" in panel-simple description. - panel-simple-edp => panel-edp Changes in v3: - Split eDP panels patch new for v3. drivers/gpu/drm/panel/Kconfig | 16 +- drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-edp.c | 1298 ++++++++++++++++++++++++++ drivers/gpu/drm/panel/panel-simple.c | 573 +----------- 4 files changed, 1322 insertions(+), 566 deletions(-) create mode 100644 drivers/gpu/drm/panel/panel-edp.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 0b3784941312..369cb76512fe 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -77,14 +77,26 @@ config DRM_PANEL_LVDS backlight handling if the panel is attached to a backlight controller. config DRM_PANEL_SIMPLE - tristate "support for simple panels" + tristate "support for simple panels (other than eDP ones)" + depends on OF + depends on BACKLIGHT_CLASS_DEVICE + depends on PM + select VIDEOMODE_HELPERS + help + DRM panel driver for dumb non-eDP panels that need at most a regulator + and a GPIO to be powered up. Optionally a backlight can be attached so + that it can be automatically turned off when the panel goes into a + low power state. + +config DRM_PANEL_EDP + tristate "support for simple Embedded DisplayPort panels" depends on OF depends on BACKLIGHT_CLASS_DEVICE depends on PM select VIDEOMODE_HELPERS select DRM_DP_AUX_BUS help - DRM panel driver for dumb panels that need at most a regulator and + DRM panel driver for dumb eDP panels that need at most a regulator and a GPIO to be powered up. Optionally a backlight can be attached so that it can be automatically turned off when the panel goes into a low power state. diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 60c0149fc54a..6e30640b9099 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -7,6 +7,7 @@ obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o +obj-$(CONFIG_DRM_PANEL_EDP) += panel-edp.o obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o obj-$(CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02) += panel-feixin-k101-im2ba02.o obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c new file mode 100644 index 000000000000..a3f609edface --- /dev/null +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -0,0 +1,1298 @@ +/* + * Copyright (C) 2013, NVIDIA Corporation. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include