From patchwork Wed Jun 15 23:23:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Kumar X-Patchwork-Id: 12883049 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 48C64C433EF for ; Wed, 15 Jun 2022 23:23:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEBF1113988; Wed, 15 Jun 2022 23:23:28 +0000 (UTC) Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id B0AEF113986; Wed, 15 Jun 2022 23:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1655335408; x=1686871408; h=from:to:cc:subject:date:message-id:mime-version; bh=lo+kFvHqy7wgcPn0SK1uyB5K0WL44i1pTzDBNOW9nuY=; b=tX6S4FLSCWmaHaAkXpI4DODdHWK1p5DLu8fcaqRmswg9SRrjlVVYEGyL 9eo5qRSQKmu0Qsh0CizvU7oxpu9ZTYGWwT4sQNucCLFbTTTjBqLkfFCV3 flLNuAaqr4rS5/qtiiQPHKTji8OVMsw5tZ5wpMHzoXI38rWBONdyTC42x I=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 15 Jun 2022 16:23:27 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 16:23:26 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 15 Jun 2022 16:23:26 -0700 Received: from abhinavk-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 15 Jun 2022 16:23:25 -0700 From: Abhinav Kumar To: Subject: [PATCH] drm/msm/dpu: set preferred mode for writeback connector Date: Wed, 15 Jun 2022 16:23:15 -0700 Message-ID: <1655335395-16159-1-git-send-email-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) 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: , Cc: markyacoub@chromium.org, Abhinav Kumar , dri-devel@lists.freedesktop.org, swboyd@chromium.org, seanpaul@chromium.org, dmitry.baryshkov@linaro.org, quic_jesszhan@quicinc.com, quic_aravindh@quicinc.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" After [1] was merged to IGT, we use either the first supported mode in the list OR the preferred mode to determine the primary plane to use for the sub-test due to the IGT API [2]. Since writeback does not set any preferred mode, this was selecting 4k as that was the first entry in the list. We use maxlinewidth to add the list of supported modes for the writeback connector which is the right thing to do, however since we do not have dual-SSPP support yet for DPU, this fails the bandwidth check in dpu_core_perf_crtc_check(). Till we have dual-SSPP support, workaround this mismatch between the list of supported modes and maxlinewidth limited modes by marking 640x480 as the preferred mode for DPU writeback because kms_writeback tests 640x480 mode only [3]. [1]: https://patchwork.freedesktop.org/patch/486441/ [2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/lib/igt_kms.c#L1562 [3]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/tests/kms_writeback.c#L68 Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c index 399115e4e217..104cc59d6466 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c @@ -10,9 +10,14 @@ static int dpu_wb_conn_get_modes(struct drm_connector *connector) struct drm_device *dev = connector->dev; struct msm_drm_private *priv = dev->dev_private; struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms); + int count; - return drm_add_modes_noedid(connector, dpu_kms->catalog->caps->max_linewidth, + count = drm_add_modes_noedid(connector, dpu_kms->catalog->caps->max_linewidth, dev->mode_config.max_height); + + drm_set_preferred_mode(connector, 640, 480); + + return count; } static const struct drm_connector_funcs dpu_wb_conn_funcs = {