Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp480291lqh; Thu, 28 Mar 2024 07:35:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXkUlXLjuIowPxqrCizdNEy0Gn00REzvVhg158ecdHUdNObSScfUztFBjGs/fTXWZ8TbKZurahDkkhA83yGOUDnIKclCLyMlu5H0wbMQ== X-Google-Smtp-Source: AGHT+IGAg9FM7Y6/l9COf69vMy97kyj5yjVQGzWscnHHPr7fsnqViOs0wAgSnZOu8QwnY5gUKxxQ X-Received: by 2002:ac8:7d91:0:b0:431:5aaa:68d4 with SMTP id c17-20020ac87d91000000b004315aaa68d4mr4300343qtd.18.1711636550019; Thu, 28 Mar 2024 07:35:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711636549; cv=pass; d=google.com; s=arc-20160816; b=sIejX+s+alGLF2YFXfzfIOxP2q7B4tJvwaa0XtZ+guDGaa/MjeESQpAUEQeCyvupJ1 Vg1ey9/ZnD8tvZmN86zCf7SVjfHSUEe9hna8syI9gIoUb3i2Y3SwsDQPZ6nay/BMXRxS nONSkJyTXU9/NpDYz2WrQyfXIfbikrilpb+gO6JEU/jTa3Axl6UTg1TXJs/8CRKUmlMg X1+l2wHADY8LIZUyj9ivytidpFtx4P17+lJwpT73rKtK5lVw9I0MggeRISTYUWnUrN1S I2vIVKTzJqdMs4oKAswse5PRwE1S4app0yaMi1wwxMSh0RJGOl+bwXgXJ33Q7z5qLxU7 g88w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=LayUrlocuUREGBe6Fc+bl9ciQ17Lofv47+FGM9X6Yts=; fh=SXWstRefROG6Gmk6nMJHio9uD832eRzLu5zkpfVox3E=; b=L72mTYrUhjvj2ZkgNfgrv7DlpJ5MFgGDWNTAySsd3z4ZhejXEtvnw8rNrSQRJmKhS+ ma5PjcCSa+mKF1Cfw4rS5Ha+ckPrZDVHt4L50IBPp8thPa4YBaIVgpk17ty8G8OoC0rH v4UV/3fXm/ETTclF1hJQpj6bd+a+9Gv5wYu/S/eXaa+3kIVaiqYcAcaQLLAnz5wsjvJf +Vx+4O4jhhoIVA7kbTOQCzRACuMzs/wil7CDWPwLq+kiiLszUt3/XcDQsuvILpbGDWFB GcAFKRCj+geUlPnB++a49yocd5ZzfjfRf1SZRTfuOdmyT0xld6iKrZ7G84wq7vxhh5br rgmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSlks2we; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 3-20020ac85903000000b004317ef9c18esi1521984qty.426.2024.03.28.07.35.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 07:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSlks2we; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8E2A81C2D0E9 for ; Thu, 28 Mar 2024 14:35:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60F0512D753; Thu, 28 Mar 2024 14:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mSlks2we" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72FAD12A144; Thu, 28 Mar 2024 14:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636525; cv=none; b=rIcjuLynRZ1aatHR0sxJn8yn3vwDMMYHpj1O5BZrChjTpA3yq/gsDMhLUw5ArsxfYR2nUQQRg2Z4lLs6c8di3KxobJQr3oDp805I2rTV/yuYqF1ACFWV/Q0IeX4kDeU5PPiMsLJDxWfaUDEwvYwj9T1iW+18c5tlnzH22MbZXoc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636525; c=relaxed/simple; bh=0cEYEHUgE6/Me+QvkgvBiu+s/9uNC8lK8X5oACHE56Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iy7cRmd48IDl8QVF7KWHpt3CQZgpQqksvGXsC+n3drRRjxPESIjC+0dF7cGmEBXCfCtAEDpBad1foBUW3tbd8EX409sadIf74L5W7lMUm6f3lkU0GUS38gzEC6aOzxoQstxRMJY5z+tPHSE/lkys5c7ciPVxCDdMpP2ECkhXojc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mSlks2we; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 612A6C433C7; Thu, 28 Mar 2024 14:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711636525; bh=0cEYEHUgE6/Me+QvkgvBiu+s/9uNC8lK8X5oACHE56Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mSlks2weB8+geHzROfWxaghEln+WgfGvaUetKP9WoypEcJEZ+k7+aKqLSHAye3zcw y9fYgryQUHNbWXIr/YHYqXY0sOa5SaFFM6L1s2kj0mMKT+qWVeFaQjA8dLILthTvhF yRJl/wdHgp9jDZOI8oeXezfcA0C0XE6sCBx7on30hFiUg3Umv3bjveYLasyL/CE5z7 fK6ifN2LkF8BYV5ESQveZIETKowSWsP0+RoVfVI+GL/YCXX1wgyCZPQH6bm2GXbRE+ YXSIDgWRzhLwOdurpNL0ehI15KRY1XaIB8cNHK4cZXpvHrDDy84BD7u7O/RZmaL6Nj nfL5iuYQFFm+w== From: Bjorn Andersson Date: Thu, 28 Mar 2024 07:40:01 -0700 Subject: [PATCH v2 2/6] drm/msm/dp: Removed fixed nvid "support" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240328-msm-dp-cleanup-v2-2-a5aed9798d32@quicinc.com> References: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> In-Reply-To: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3728; i=quic_bjorande@quicinc.com; h=from:subject:message-id; bh=0vv6dHvH1Y3qLumDrHkbFNSd1KxWXUhkg/ici0zD3/E=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBmBYFIJyG4Bpka/lZ36d0NIAxWzb8f7xxbF/EXz 08TIi2IYn2JAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZgWBSBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcXEDxAAo/y5Bl23YhYys1s5o53g3LGqPxdYpxxiVejD2cq uOP4bGLodGQDu3sHJdjVB53uh3HO+QG8TklN8/kkDU4nXeYR1xTOL49Z99ZkUD6d5hphC3MCD1M VlIVp5G+C3R5SraNeXOL+HzcI6HWmOhAiGVExLJjcJADY4eZl9aDqiTZLeFI/y6XBvOsswUWM4y LD4PnajWTV/1ER9qjNnW6RkQheku3zXJuge27L0I4LNeF18lRu9JvtORngt19479qjguBEez7Hm jl08G1aCbtddiTrh88zF1IbNWbZ1yGlfmU67b0jysSHjnvKuB7rHxaNyZ2UnZtxINYlxK9mRRTs 5IuMd/EGPMrvgccMMt9rnRfL3QbLzz8d5M/WIPWjGO9Njq8lEEbjI3rfdpHxiQwQm0TCZHQFjLd eoqq9QpM4UoomEaXIkCNRrig3fFv2nqMmTA7DnXXBt3IClHBJGTLcK9ZImmNGFx8ODVAjQSE6ev el2wjsG9L1R0pp5GuPURS1bDKEMvF6h1GZMELAKxA+cQMXUQNpFmNekSRoPWfOy6hN4o3vKmjy0 a1IRSD81AwjiEKvwPQrrbfQ9Km8yZQfDaX++zaJx+hOkrJHZC8fZ+J9tuZ2DFmfeBHnTIQ0fWiJ WMx2cXtV6ZRKlZiiJ4Hy5Ml8xKiOnMdWivDNzeoc7lNY= X-Developer-Key: i=quic_bjorande@quicinc.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 From: Bjorn Andersson The "desc" member of struct dp_panel is zero-initialized during allocation and never assigned, resulting in dp_ctrl_use_fixed_nvid() never returning true. This returned boolean value is passed around but never acted upon. Perform constant propagation and remove the traces of "fixed nvid". Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_catalog.c | 2 +- drivers/gpu/drm/msm/dp/dp_catalog.h | 2 +- drivers/gpu/drm/msm/dp/dp_ctrl.c | 17 +---------------- drivers/gpu/drm/msm/dp/dp_panel.h | 1 - 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c index 3e7c84cdef47..8c72d532d96b 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.c +++ b/drivers/gpu/drm/msm/dp/dp_catalog.c @@ -469,7 +469,7 @@ void dp_catalog_setup_peripheral_flush(struct dp_catalog *dp_catalog) void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog, u32 rate, u32 stream_rate_khz, - bool fixed_nvid, bool is_ycbcr_420) + bool is_ycbcr_420) { u32 pixel_m, pixel_n; u32 mvid, nvid, pixel_div = 0, dispcc_input_rate; diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.h b/drivers/gpu/drm/msm/dp/dp_catalog.h index 75ec290127c7..b85ad6bdb2e7 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.h +++ b/drivers/gpu/drm/msm/dp/dp_catalog.h @@ -99,7 +99,7 @@ void dp_catalog_ctrl_psr_mainlink_enable(struct dp_catalog *dp_catalog, bool ena void dp_catalog_setup_peripheral_flush(struct dp_catalog *dp_catalog); void dp_catalog_ctrl_config_misc(struct dp_catalog *dp_catalog, u32 cc, u32 tb); void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog, u32 rate, - u32 stream_rate_khz, bool fixed_nvid, bool is_ycbcr_420); + u32 stream_rate_khz, bool is_ycbcr_420); int dp_catalog_ctrl_set_pattern_state_bit(struct dp_catalog *dp_catalog, u32 pattern); u32 dp_catalog_hw_revision(const struct dp_catalog *dp_catalog); void dp_catalog_ctrl_reset(struct dp_catalog *dp_catalog); diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c index c4dda1faef67..e65a460fb52d 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -1566,21 +1566,6 @@ void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl) phy, phy->init_count, phy->power_count); } -static bool dp_ctrl_use_fixed_nvid(struct dp_ctrl_private *ctrl) -{ - const u8 *dpcd = ctrl->panel->dpcd; - - /* - * For better interop experience, used a fixed NVID=0x8000 - * whenever connected to a VGA dongle downstream. - */ - if (drm_dp_is_branch(dpcd)) - return (drm_dp_has_quirk(&ctrl->panel->desc, - DP_DPCD_QUIRK_CONSTANT_N)); - - return false; -} - static int dp_ctrl_reinitialize_mainlink(struct dp_ctrl_private *ctrl) { struct phy *phy = ctrl->phy; @@ -2022,7 +2007,7 @@ int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl, bool force_link_train) dp_catalog_ctrl_config_msa(ctrl->catalog, ctrl->link->link_params.rate, - pixel_rate_orig, dp_ctrl_use_fixed_nvid(ctrl), + pixel_rate_orig, ctrl->panel->dp_mode.out_fmt_is_yuv_420); dp_ctrl_setup_tr_unit(ctrl); diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h index e843f5062d1f..9afd99e00b0c 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.h +++ b/drivers/gpu/drm/msm/dp/dp_panel.h @@ -40,7 +40,6 @@ struct dp_panel { u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS]; struct dp_link_info link_info; - struct drm_dp_desc desc; struct edid *edid; struct drm_connector *connector; struct dp_display_mode dp_mode; -- 2.43.0