From patchwork Tue Jul 23 06:26:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiong Lv X-Patchwork-Id: 13739372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD350C3DA63 for ; Tue, 23 Jul 2024 06:26:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D18210E0BC; Tue, 23 Jul 2024 06:26:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="g/yOOoN1"; dkim-atps=neutral Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9E79210E0BC for ; Tue, 23 Jul 2024 06:26:30 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1fc66fc35f2so3774205ad.0 for ; Mon, 22 Jul 2024 23:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1721715990; x=1722320790; darn=lists.freedesktop.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Gkiwi2HblLWIRJEo+ICl77dLaAlbyjAEjVCFsYMguCg=; b=g/yOOoN1y8RZ/DNTwr2IC9RzV8FcjSR1THsucu3Uw1591Yby8JqISjVK+vx3ceyAlc +DK06wY+8zWW7Ym0hAtEJk2fxu0wlz4Gof8cZwSOyyxTruOx06fCLSzrv0Kv40upRFF5 1MCBPt4eyQFFQdmHIQWiifzwQu0IGSw4mHriyDYW3XlnrWLjhql5REfNcJHEq6Jp32rm X9gHmW/MdUFq1QMLjdF7+RgqAO7miLHaFT6aUOOSo58A3LFZC1EGstXMjDppmw8/e4Ju XsOzzwkVps3pcg2mUY3RygfGL6bvXf39uXlR7bC9dGkUMUT31h2Ks0OtBUAgyLLcQDVh 0v3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721715990; x=1722320790; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gkiwi2HblLWIRJEo+ICl77dLaAlbyjAEjVCFsYMguCg=; b=mRcsNWcJIMLvlAii86btLIfVH57w5jTM1q17mr/MthqhYRl3VN6IYSD8EPBIVkp9Ds 2hIOLlBiTVOCNcj6rNe0JeRToPvDQCYiVcIQxlxWg7rnIoIkEaXsLS2VorrRp1yPX+9E SnSU4e1Ta2HdXL/qp6sNZDlcLgEG5fC+qXBC4bPadcjFJL1B+y6xXYhj7NQDPehnnVu3 g5WJRAGb9L71aLOM5/L0da0O2SfcO3f8xf3ecv9N5YBYtSt3jwuKNPGVvkHsZjh8KFVy JtJylsbCJ8HTeeC2WB0pWmH36qrwx5kI6aFy2u4yATfSFUqBjD7jgidcMCC0/DfayXV7 f2ZA== X-Gm-Message-State: AOJu0YzgyN4xR3tTSdrbWwzH/eGqSLSt3l93JRmbGEzleNylAkdqsT9T zWuqhBAvoW0w4c/wyFaMYix01zoceJTOvnjY1B9J7GqV1rQqT/fTejG8RXJDDhI= X-Google-Smtp-Source: AGHT+IEMEYV49A/7sN13fNs7QtDLUZ+KsEivgaXNWoeS2uNGXFKSc3HIPXHBpH2cEqizv54RUEDbdg== X-Received: by 2002:a17:902:d509:b0:1fc:4acb:3670 with SMTP id d9443c01a7336-1fdb95128e9mr16250375ad.12.1721715990126; Mon, 22 Jul 2024 23:26:30 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f25ab47sm66351465ad.45.2024.07.22.23.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 23:26:29 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, quic_jesszhan@quicinc.com, sam@ravnborg.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, dianders@chromium.org, hsinyi@google.com, awarnecke002@hotmail.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v4 1/2] drm/panel: boe-th101mb31ig002 : Fix the way to get porch parameters Date: Tue, 23 Jul 2024 14:26:14 +0800 Message-Id: <20240723062615.14796-2-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240723062615.14796-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240723062615.14796-1-lvzhaoxiong@huaqin.corp-partner.google.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The current driver can only obtain the porch parameters of boe-th101mb31ig002. Modify it to obtain the porch parameters of the panel currently being used. Reviewed-by: Douglas Anderson Signed-off-by: Zhaoxiong Lv --- Changes between V4 and V3: - 1. No changes. v3: https://lore.kernel.org/all/20240722092428.24499-2-lvzhaoxiong@huaqin.corp-partner.google.com/ Changes between V3 and V2: - 1. No changes. v2: https://lore.kernel.org/all/20240716121112.14435-2-lvzhaoxiong@huaqin.corp-partner.google.com/ Changes between V2 and V1: - 1. No changes, Modify the commit information format. v1: https://lore.kernel.org/all/20240715031845.6687-2-lvzhaoxiong@huaqin.corp-partner.google.com/ --- drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c index b55cf80c5522..d4e4abd103bb 100644 --- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c @@ -312,15 +312,14 @@ static int boe_th101mb31ig002_get_modes(struct drm_panel *panel, struct boe_th101mb31ig002 *ctx = container_of(panel, struct boe_th101mb31ig002, panel); + const struct drm_display_mode *desc_mode = ctx->desc->modes; struct drm_display_mode *mode; - mode = drm_mode_duplicate(connector->dev, - &boe_th101mb31ig002_default_mode); + mode = drm_mode_duplicate(connector->dev, desc_mode); if (!mode) { dev_err(panel->dev, "Failed to add mode %ux%u@%u\n", - boe_th101mb31ig002_default_mode.hdisplay, - boe_th101mb31ig002_default_mode.vdisplay, - drm_mode_vrefresh(&boe_th101mb31ig002_default_mode)); + desc_mode->hdisplay, desc_mode->vdisplay, + drm_mode_vrefresh(desc_mode)); return -ENOMEM; } From patchwork Tue Jul 23 06:26:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiong Lv X-Patchwork-Id: 13739373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D3E3C3DA63 for ; Tue, 23 Jul 2024 06:26:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6E6F10E43E; Tue, 23 Jul 2024 06:26:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=huaqin-corp-partner-google-com.20230601.gappssmtp.com header.i=@huaqin-corp-partner-google-com.20230601.gappssmtp.com header.b="yvtgQt8v"; dkim-atps=neutral Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0EB510E427 for ; Tue, 23 Jul 2024 06:26:35 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1fc49c1f3e5so38312745ad.1 for ; Mon, 22 Jul 2024 23:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1721715995; x=1722320795; darn=lists.freedesktop.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=a4U/lX5wwRXFBYNa5qyfaellagLlJY0UfTFYRgdibjk=; b=yvtgQt8vCZYfW30TT60+S5LNQb2of4ZVCjnaZrwnykDA88y7qmyn84wwxYt+74yLEh dKXL5yW9IGGTRcxO+3vrb0WF99AwCIsmQJjU5XfP2JD2TEdFGYwv+ogvjDhwtdSG9Izz XfLr1PMeBRZBCWqlWMiivZ49mcDqLqZvUMmYF+d7sMS6Tnt1ivp8fxEFqveoBw7LVSIL 7a0kjhSiAQ1E5crqbpfAWvuMXDNVZERLaYvl6siboDRONTKar8wYTbbCNmSnpWzsaGBi D5cxrqNx8tgYnFYOQC3qaXKGGa4ZViOIWc4Si9iKulsfXiU0Psh8MuMuaGYRuo6+owNZ VuRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721715995; x=1722320795; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a4U/lX5wwRXFBYNa5qyfaellagLlJY0UfTFYRgdibjk=; b=gNjUNPH6bf0vyAHb36oVhJ9cmRvt/f4hhxyq4Kt73qrNgLU1bTH9WmduFuCMN/SYwE B98XCfKv6Ek78xbr08ToU1XS+YEHlPXWSE6hlDNPEqvKf0xb6gGbmiZIA7pdVN2SLNgV G1o9qnncMtN5/K7DXZI909FIdL23YxPjyQBkkRQyVMNGMN1avrpnbCVzUrAX9l+H54xk NYchKtjzARifsgv5JJXZUl/VT+0UVJr1396tClzFZli4cPHc9EQEzKg79GDFDTFXQHTZ p7JnpRj2LEBM4nRyVx3kzcEu2eK34Pu/304Tt7NpjTolcdhGILBBYHoTuE5A1cM4VY4b HIpA== X-Gm-Message-State: AOJu0Yxyg+7PGepsjmQjJO/uepDonHyV6GApsRqIhL3lMJBgmaE7nEEH 0cpadcK7drwjkSMP+qHyCe6OPd+9PWo9MfMweo9jzMFt3i4esF7QHylL7cJgBns= X-Google-Smtp-Source: AGHT+IHVekg2SGD27MeBu8a61N2QblO1dxpPiH7hnQpFqY1dwa+oz13T7HNCePcM1CZMQrcn7ELDFg== X-Received: by 2002:a17:903:2306:b0:1fd:69d6:856d with SMTP id d9443c01a7336-1fd74598718mr72102175ad.17.1721715995165; Mon, 22 Jul 2024 23:26:35 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f25ab47sm66351465ad.45.2024.07.22.23.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 23:26:34 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, quic_jesszhan@quicinc.com, sam@ravnborg.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, dianders@chromium.org, hsinyi@google.com, awarnecke002@hotmail.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v4 2/2] drm/panel: boe-th101mb31ig002 : using drm_connector_helper_get_modes_fixed() Date: Tue, 23 Jul 2024 14:26:15 +0800 Message-Id: <20240723062615.14796-3-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240723062615.14796-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240723062615.14796-1-lvzhaoxiong@huaqin.corp-partner.google.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use public functions( drm_connector_helper_get_modes_fixed()) to get porch parameters. Signed-off-by: Zhaoxiong Lv Reviewed-by: Douglas Anderson --- Changes between V4 and V3: - 1.Modify the return value, return drm_connector_helper_get_modes_fixed(connector, desc_mode). v3: https://lore.kernel.org/all/20240722092428.24499-3-lvzhaoxiong@huaqin.corp-partner.google.com/ Changes between V3 and V2: - 1. Keep bpc settings and drm_connector_set_panel_orientation() function.. v2: https://lore.kernel.org/all/20240716121112.14435-3-lvzhaoxiong@huaqin.corp-partner.google.com/ --- .../drm/panel/panel-boe-th101mb31ig002-28a.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c index d4e4abd103bb..0b87f1e6ecae 100644 --- a/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +++ b/drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c @@ -16,6 +16,7 @@ #include #include #include +#include struct boe_th101mb31ig002; @@ -313,31 +314,15 @@ static int boe_th101mb31ig002_get_modes(struct drm_panel *panel, struct boe_th101mb31ig002, panel); const struct drm_display_mode *desc_mode = ctx->desc->modes; - struct drm_display_mode *mode; - - mode = drm_mode_duplicate(connector->dev, desc_mode); - if (!mode) { - dev_err(panel->dev, "Failed to add mode %ux%u@%u\n", - desc_mode->hdisplay, desc_mode->vdisplay, - drm_mode_vrefresh(desc_mode)); - return -ENOMEM; - } - - drm_mode_set_name(mode); connector->display_info.bpc = 8; - connector->display_info.width_mm = mode->width_mm; - connector->display_info.height_mm = mode->height_mm; - /* * TODO: Remove once all drm drivers call * drm_connector_set_orientation_from_panel() */ drm_connector_set_panel_orientation(connector, ctx->orientation); - drm_mode_probed_add(connector, mode); - - return 1; + return drm_connector_helper_get_modes_fixed(connector, desc_mode); } static enum drm_panel_orientation