Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1030325pxb; Wed, 1 Sep 2021 15:45:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzArD6BtO729MGL1sMXR/bNjhH1DCKbG7mQqcE/JPQCeVSU9kGNWeNlsX4whXIaB18pSWxo X-Received: by 2002:a17:906:a08d:: with SMTP id q13mr160133ejy.465.1630536355304; Wed, 01 Sep 2021 15:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630536355; cv=none; d=google.com; s=arc-20160816; b=g0y4PrJ6V2FRO6jIBkwAmmUMe10ONB9NEpaTEnn9WLlchWtrocvfmncA+Y9YUEe0wW +hMZIrR4Kiu+YgMJ8+f1xk3GPLBNDk/CI2hNP0CqJCx0nrL2uvVqyl/7T+b6N42fPevo 80I4WMncxTjxfk8rfihyTtUgIl8fA4uCj96JcQSiKU1VpEMhdm39FA49tMuSe/DZKOZX OsrIsSL1O3deSqyu/cJU5OkI2QYzEBTRJEnr4qya9kZQBdR6xNJyOTUPvCiv4H3C8C2u CyFHPAUG/nbvztSZUeWBmPtumoie9859V/494V6oFH7KqXNyl2Utb1Vl5Vf2Tx6roHI/ Qblw== 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=Mz9HeGJ+K7sval94JDg800KjqgtCuquTPW7QtWQlZWM=; b=IkLGuM//PMyy+BxsFoCyfQeNnxdiJlWRXDAcQojpEU8eKcFTd/06zsX1lz0saQ1rGv DgNdc6eKrDEhzRhTO7oYDP87ZhbLi2jjaPEI8MBBsnYcw/Zhu+JtsXNCxjjM6cyqG0PC eGB5gtxhcypCkESaaBvSzhbS9IBj9UcxV31uOi6ugR/0K8ItAhV2HoRsPtFhWfzYW4Zl UFaduA+n6oOS/q6VqLSIjUwgOqIRhHuQrRZKOEHfpVCbYYyb17nAqQoIuIBoGkqcvM8K R1VfAh/y8TiPhZuKzaXafZLgVfofhw106Nvqi+qromA9vVu0u7BmbavgSX+IZfcwhu6O fwqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="jzTj/pD5"; 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 u61si148256edc.375.2021.09.01.15.45.30; Wed, 01 Sep 2021 15:45:55 -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="jzTj/pD5"; 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 S1344882AbhIAUWL (ORCPT + 99 others); Wed, 1 Sep 2021 16:22:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245379AbhIAUVd (ORCPT ); Wed, 1 Sep 2021 16:21:33 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 842E0C06129F for ; Wed, 1 Sep 2021 13:20:35 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 7so721827pfl.10 for ; Wed, 01 Sep 2021 13:20:35 -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=Mz9HeGJ+K7sval94JDg800KjqgtCuquTPW7QtWQlZWM=; b=jzTj/pD5dkkQYgZIwhNNMzeq/pE4Xb6qyV9tG+wlV200QFulkiGCrLE2/ks/Oin4ki vV2AH4GTsmOhS/K6/mRqlC9T57ARHF/I0GeFIN7CwUdMWbgtxN3MLd45pO1gnwd79dab 11tmOHElLexVfJ2YrHXx/ZLy3hEYckYwe6dQk= 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=Mz9HeGJ+K7sval94JDg800KjqgtCuquTPW7QtWQlZWM=; b=r8AahRK5d/HyedqrhC0qZdtkNSfunEoepuIW3sZy3YJbtsCqxaz+HV40ng/iikbIDd nj5i5C2g2B7CLhhAGsvuQvQY4oqxC/A71h0bx33WSdMPXMM6fDwytdTil0GaSZzgB3RN aN6Bks7yTMsTMhRs4Diqo46KWZp2iTX+YeFQ/Q7+Kgsw3thQ0BrPp7KrtGMlwlWHj/z9 AXFA8Tx+ADwoOKU2sYZbE/us/dhxgkdmhVOqBQ5ggLV++hoVVzvCgsiUSJi71F3Rj2/6 6TPixdmtHwvqqgxfKyBWi5DIFMAooi8cdbL+/VdWqWZ3Ssf8vAtSuOgYCAdSa0BCXi+n UllQ== X-Gm-Message-State: AOAM532ZwyxETQ+UgvQ9l/SoIoveQvluuDpIZPbk/k46pufYSGDTu4Yy E/YZUZiDOwtPuZUrJdm6d+RADA== X-Received: by 2002:a63:ff51:: with SMTP id s17mr762145pgk.415.1630527634673; Wed, 01 Sep 2021 13:20:34 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:958b:b561:a735:e774]) by smtp.gmail.com with ESMTPSA id x15sm321178pfq.31.2021.09.01.13.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 13:20:34 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Rob Herring , Sam Ravnborg Cc: Maarten Lankhorst , linux-arm-msm@vger.kernel.org, Bjorn Andersson , Linus W , Daniel Vetter , devicetree@vger.kernel.org, Steev Klimaszewski , Thomas Zimmermann , Maxime Ripard , David Airlie , dri-devel@lists.freedesktop.org, Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH v3 05/16] drm/panel-simple-edp: Split eDP panels out of panel-simple Date: Wed, 1 Sep 2021 13:19:23 -0700 Message-Id: <20210901131531.v3.5.I0a2f75bb822d17ce06f5b147734764eeb0c3e3df@changeid> X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog In-Reply-To: <20210901201934.1084250-1-dianders@chromium.org> References: <20210901201934.1084250-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 --- I believe this is what Sam was looking for when he requested that the eDP panels split out [1]. Please yell if not. [1] https://lore.kernel.org/dri-devel/YRTsFNTn%2FT8fLxyB@ravnborg.org/ 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-simple-edp.c | 1298 ++++++++++++++++++++++ drivers/gpu/drm/panel/panel-simple.c | 575 +--------- 4 files changed, 1323 insertions(+), 567 deletions(-) create mode 100644 drivers/gpu/drm/panel/panel-simple-edp.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 0b3784941312..4b7ff4ebdc34 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_SIMPLE_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..640234d4d693 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_SIMPLE_EDP) += panel-simple-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-simple-edp.c b/drivers/gpu/drm/panel/panel-simple-edp.c new file mode 100644 index 000000000000..5b47ee4bc338 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-simple-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