From patchwork Tue Jul 16 12:11:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiong Lv X-Patchwork-Id: 13734497 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 E39EBC3DA49 for ; Tue, 16 Jul 2024 12:11:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C03610E698; Tue, 16 Jul 2024 12:11:29 +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="obRC1GzV"; dkim-atps=neutral Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D87E10E699 for ; Tue, 16 Jul 2024 12:11:28 +0000 (UTC) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-70aec66c936so3953178b3a.0 for ; Tue, 16 Jul 2024 05:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1721131888; x=1721736688; 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=blbSlELLECRmvXwv7SN5IDYSjruj8AHGnyhct2EWwU4=; b=obRC1GzVqEnJVLIuY4EwlyhKchqZBoJK4FTspiPuOQnDn3TxU5U6NFtaEWn90/Yvf1 UiQ69xI4QOwea/Kb1s/OiRnkwRhhoiflJVU3N6Wdn8RT+PXCMYDbw2UUvTnayuLxx19L 2LFy3E41giuAzZfNconssM9JiZmKIkMOQAAfLB8abOGfSjDKV2pZ7L2o0v+GCBhVdpwz dLRHRgX7tfFvu5CB/Rws7s2R2lbTwll/DPlnO0OO2DLWXUhWQTkTbnJNAmDTCCGXjev2 bKEKpbyJNB5xe9838dosQWipOck4C3HGmiMgBzmlOrtmD0wFvOR3CEKOnSvD7LUzncQ8 Kztg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721131888; x=1721736688; 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=blbSlELLECRmvXwv7SN5IDYSjruj8AHGnyhct2EWwU4=; b=gOlOgDMUPkF5MmrbBULmFH1RMfB7rK/Gpeyaqw7ShWNsFhT3crD/CRTZyR71XRcKhA KfyA0AwxZRZqd82FTKktcAAZACQz7eEfPXIYdACZSnkcFI+hZEuFLy1hJ7FDwi+nYvB2 vbbY6R/Vj3zcnoYQib1f8gUTuMzg6YamprMeOzG0Zku6Naohxwgop/orntjzoDMl8AYK 9NnDioA59kQvCcsAdxp32kZ4q22I8JuN1em6eTVKjNM3XrtDB/ZSorveEPUap2RUTwPe 4SZvK/QEvbKUQCDWdBddppnZaEB0A5QTf6W3450JJyGAZOejgifBVQSswW0UwL5tVPyz Bcgg== X-Gm-Message-State: AOJu0YwnaPg5kyLN3Vj5E1CoerZDC7NmhHFbrU5xtVwY+dcriofHl4hb qJxju6ylQpXTUkUcA3kpGnVnAoEt7Q34XjKyJMXtQuClPzORxV5NdTDoWP15GEE= X-Google-Smtp-Source: AGHT+IH/k4jWImyIjbW7yGtrYYEDR8z48Mphe/dvltvql6yF6cg+o7MKJy0g0ldWT8SGBXoYS+4sGA== X-Received: by 2002:a05:6a00:3a19:b0:706:5dab:83c4 with SMTP id d2e1a72fcca58-70c1fba1248mr2131358b3a.14.1721131887544; Tue, 16 Jul 2024 05:11:27 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b7eccc48bsm6114065b3a.203.2024.07.16.05.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 05:11:27 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, airlied@gmail.com, mripard@kernel.org, dianders@chromium.org, hsinyi@google.com, awarnecke002@hotmail.com, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v2 1/2] drm/panel: boe-th101mb31ig002 : Fix the way to get porch parameters Date: Tue, 16 Jul 2024 20:11:11 +0800 Message-Id: <20240716121112.14435-2-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240716121112.14435-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240716121112.14435-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. Fixes: 24179ff9a2e4524 ("drm/panel: boe-th101mb31ig002 : Make it compatible with other panel.") Signed-off-by: Zhaoxiong Lv Reviewed-by: Douglas Anderson --- 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 16 12:11:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiong Lv X-Patchwork-Id: 13734498 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 090DAC3DA49 for ; Tue, 16 Jul 2024 12:11:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EA9710E6A2; Tue, 16 Jul 2024 12:11: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="diu+MSfX"; dkim-atps=neutral Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id E1D1510E69A for ; Tue, 16 Jul 2024 12:11:33 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-70b0bc1ef81so3510034b3a.1 for ; Tue, 16 Jul 2024 05:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1721131893; x=1721736693; 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=ctnk4Qig36T6nuqfFemKrVj0VTPFOFW8uO+7ZSbbM1w=; b=diu+MSfXYpsuQZkYwMa+LLtyZmSptECXcF/w4qw5D8ppxirQd4PodP2g8RnSMjlXr/ q7yHz64A1tsmZuqnCWQNXozFXYaDanNMVq/0MsjBSrtMlXujVUvsTxvVaZcO3VuKrknq Ajfr/axS9BTV889FtuYROU3pKJaZjOpOrLtgj+3phV6nF6/htVkb14D5TgrTs7oAxNuf i5VSWDefwebpe3fOwg0Ez+qavmPDBpsfRgE3JDUvXGbFCMlP0hbbal/wGdoyRprJwYeC EzYbzMK1juKU2JsBH1xZfHdYVXj38K2riyGswKTgJ9yR2PfO8F0NzRWuP63f0V8ya3hA vmOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721131893; x=1721736693; 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=ctnk4Qig36T6nuqfFemKrVj0VTPFOFW8uO+7ZSbbM1w=; b=PAwCsSIDIqVFl9XxrssXTUSBn9vLGtDo1qG/5575F04DHB5WsRH+m3Kh0Taeh6ED/w Q1kmWMhqvypPMUWYpdlA/jm5y0sE3NcPB9fAg7bHx1KYqAIROgb8x5Wd2ncd0/nQZXnq hdz2VaW7zKxu6WeF2lviZN2+bRlYoisHN6+BB1f4PlFPrtcY9uQMype2k5zSyHU5T40u 3W74KYF/yP1aiMMVODGciZJb23qmoPaPy1BmHvb23llBOd9S+0hRwT0t8ZuaHFrbs9x9 XiboqmVYRVGTV+xz2kSgafdVmqBvppHpOGZNYnxA7J4GU8kIHvqb6b21/h4q9jaZYBtb CLkQ== X-Gm-Message-State: AOJu0YymgkA4GeGXecGeCxFBzIHzu4HtBZIBZcvv/rGNrOx8HbWW2+18 EsHdpT7G6RC4IlI+pll8hCyq1T5TMQien8XjPyCWW4AXbaOU7tkpMB6/CYyqsJg= X-Google-Smtp-Source: AGHT+IHm5RsQCEppC5izT7ZdsLIybhwjJpUCuQ5C82fMYEhLvy546hF8MA0rbBuj+iMezEQ+roGyiw== X-Received: by 2002:a05:6a00:3cd2:b0:706:700c:7864 with SMTP id d2e1a72fcca58-70c1fb112a0mr2261549b3a.4.1721131893327; Tue, 16 Jul 2024 05:11:33 -0700 (PDT) Received: from lvzhaoxiong-KLVC-WXX9.huaqin.com ([116.66.212.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b7eccc48bsm6114065b3a.203.2024.07.16.05.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 05:11:32 -0700 (PDT) From: Zhaoxiong Lv To: neil.armstrong@linaro.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, airlied@gmail.com, mripard@kernel.org, dianders@chromium.org, hsinyi@google.com, awarnecke002@hotmail.com, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v2 2/2] drm/panel: boe-th101mb31ig002 : using drm_connector_helper_get_modes_fixed() Date: Tue, 16 Jul 2024 20:11:12 +0800 Message-Id: <20240716121112.14435-3-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240716121112.14435-1-lvzhaoxiong@huaqin.corp-partner.google.com> References: <20240716121112.14435-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 --- .../drm/panel/panel-boe-th101mb31ig002-28a.c | 26 ++----------------- 1 file changed, 2 insertions(+), 24 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..4a61a11099b6 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,8 @@ 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