From patchwork Sun Dec 22 05:00:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 852968 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 153B3487BF for ; Sun, 22 Dec 2024 05:00:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734843652; cv=none; b=oYS2yD1/8eAbKPaJdhcQcBuraRjoFb1b7w5sa07XCckSWgZMOmmgN4j/7SZjoBcAjWOoAEznJ4SPBwdKHAQakfRhAxj36oVz56LDThYPDcM0HO6Zki9YhU4wSB2cpOjU1kSEBtBz7dhpilF/z9Qx83+fHFEP25leuQvT6Yl6fZo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734843652; c=relaxed/simple; bh=lEzV2DFxHSmrj9mC/gnIKltRLYW/iHK8CYgZvjQpABw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lL3TiMn0AG79dr/TtjR+ePqKPQz/ukhNWSZX6wgr5n3YN5nQIL/5RUg3gM+40VlPClRjdq7uvQcC2G68aHc5fqnCEO6QePZuPlfFqPWBhtko0JklXrYtBQ7gd1MTvddnzkCizWrvZH3Jz4rkgGfpnYERrnWFYSOorCDI48l+8ic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DdxV+KUa; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DdxV+KUa" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-54024ecc33dso3873217e87.0 for ; Sat, 21 Dec 2024 21:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734843649; x=1735448449; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=WUHXS68dzii47sCyHoBGO1JrTDTtIN7oWeXHXt5K2JQ=; b=DdxV+KUad3CUYhwfgEjbNe9hmQxJU+olBcwMSESaCkzYC0FFAEp7cZo9kzXkWnAteO StKlYreroI5/nieUMa1ZWVjHT0SCfXawl4ik/WnHAXAYLunfuIKJpVlgFx2Ri23mbV2z HUIEh7i6gQxG9CGxiPBQmKmiV6CwZFC4ZRPSDBz4vQGCx8GkE8uwH9GdhzYXB7QFb67V 2IjQdg95ECd4MlSczLzfguHLSkj9ERlzL8OzT5MXWgAlTdDQKFDHmCS0HD0sQAeI9Nrs xWoz122742JzlNVDBcM2Vj9jFdsqnau207RiVa3xvUUNW/ONQbg60AzGSYvOEfT8pKfu rgig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734843649; x=1735448449; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WUHXS68dzii47sCyHoBGO1JrTDTtIN7oWeXHXt5K2JQ=; b=cd8eGk8YgcAQtw/b+fttT+glMhjIu2I+bobLhs2dhLF/TTw3QIHyl4GnbSqvHgTfTJ qbo4lJ/qHzWo4fDIXPL13stPyH7nX3KZT08Ej+fkeydL0ZrLwUcuS+0KLyAvtnQrMgjJ 4G45wjWD++qXrsGHMEoI5gc4SJJXH0zN8wMFvkkfJen3O6JWdblm3V9OgVSbymBo5Maa g3F+gYUURCpShmB4OiJvCSPKdKhXWodH9UaFXCl0l7GjYtFG7Y5LjhoJa8d9qqfVwxs3 o4HfUg7xY2C7ryZl/A3qNcNtZPYVcGjwhijxzal+C1nZZdW049D+oTOpwMg8nb2q1AFZ C8Jw== X-Forwarded-Encrypted: i=1; AJvYcCWv906d5wGlCVccQlMLO7OQkvKd61PS+Ep1yZpkywwXk+EfpGLi8EROAkLcDFvsWvVC2mcJ0SdnPFL7Y6iH@vger.kernel.org X-Gm-Message-State: AOJu0Yxq1tEaahLvogVOdBeWA54ZGNYCobaAYO3CRDtKwi8m7sEIzgB4 s9j6bX8UL80s7LH3cCMZdHyk/fwrBIaz9vLwUJsHlYPoKvTmMuPvECDwvlyuEpg= X-Gm-Gg: ASbGnctH2QPFCKOvYL2Wm2juJFo2g+/MbX4efR6g1olTOsfP3iJkBvxy0n5Mmpw4JAQ aaAYosEXqS+F1p4gSUMSqGJTDuEaiPVnIzO/A8tSv9E/15FOcE6sxUXyZFORrdv83LCRi0c5qfw JQxv4WBSR9OZmrn2DEtozcwh6gCE/NwoRlW3sY8LELAo6zk+XAbQHfEixhZamsWzPBlRsvZ9sUD 63VPZwTg779/cVKL5vZFxfa1pjbYJ73iVqWZW6ZnA0SSKYMlTh7AHMGP1ybhYL4 X-Google-Smtp-Source: AGHT+IF+Pt1nCCP5OVvGkhTdNXEz4B1kunIC5TH+Ahw6Mi+g/aUmHdjgPeeYunkjxCOH1d29CuDaLQ== X-Received: by 2002:a05:6512:31d1:b0:540:1dac:c038 with SMTP id 2adb3069b0e04-54229524fc7mr2631228e87.1.1734843649198; Sat, 21 Dec 2024 21:00:49 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54223832c05sm887145e87.276.2024.12.21.21.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 21:00:47 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 22 Dec 2024 07:00:41 +0200 Subject: [PATCH 1/6] drm/atomic-helper: document drm_atomic_helper_check() restrictions Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241222-drm-dirty-modeset-v1-1-0e76a53eceb9@linaro.org> References: <20241222-drm-dirty-modeset-v1-0-0e76a53eceb9@linaro.org> In-Reply-To: <20241222-drm-dirty-modeset-v1-0-0e76a53eceb9@linaro.org> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Chandan Uddaraju , Jeykumar Sankaran , Jordan Crouse , Sravanthi Kollukuduru Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Archit Taneja , Rajesh Yadav , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Simona Vetter X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1373; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=lEzV2DFxHSmrj9mC/gnIKltRLYW/iHK8CYgZvjQpABw=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnZ5z7nPIekJhdnUK5YoeVX9bvlTyiNvqjiLjxF HpRt+nQbpqJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ2ec+wAKCRCLPIo+Aiko 1Wr9B/40R/wzCdA6LcKR5piuLK5GBYyyXYi+7z6d1Ml4lcBIde24q+/8h69RHvVODCvzFYcRG43 RU+/30LCutV5t2i0fS2sc/ZDYUFxAsLkUADrXK9YswlbqT1K3Jscky9S2+TWLxEskNFPwP5GSUI IumfzysS9OagOKAtHinV+1OOi4rARn7NsWyHUOlqiIedR1j+STxpB7D3J/dwHa0EVHjQrl2YTVS MQ+WKXsWgN4uLX0K1jQXgpBSXgVYUyNjvqBEVOqT9GjEGdhPP03CHccy0hZgR93nPCV93pTP4Fg Ao9XIaGu26sfYfQPSBiLeKSV6rEifwYMjU6y0AT9T6Jq2tOk X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The drm_atomic_helper_check() calls drm_atomic_helper_check_modeset() insternally. Document that corresponding restrictions also apply to the drivers that call the former function (as it's easy to miss the documentation for the latter function). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_atomic_helper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 5186d2114a503701e228e382cc45180b0c578d0c..f26887c3fe8b194137200f9f2426653274c50fda 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1059,6 +1059,15 @@ EXPORT_SYMBOL(drm_atomic_helper_check_planes); * For example enable/disable of a cursor plane which have fixed zpos value * would trigger all other enabled planes to be forced to the state change. * + * IMPORTANT: + * + * As this function calls drm_atomic_helper_check_modeset() internally, its + * restrictions also apply: + * Drivers which set &drm_crtc_state.mode_changed (e.g. in their + * &drm_plane_helper_funcs.atomic_check hooks if a plane update can't be done + * without a full modeset) _must_ call drm_atomic_helper_check_modeset() + * function again after that change. + * * RETURNS: * Zero for success or -errno */ From patchwork Sun Dec 22 05:00:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 852967 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE0DA155747 for ; Sun, 22 Dec 2024 05:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734843657; cv=none; b=ALMwYph9eoHIZnQeGRN8+RD0tD28CHkA8OL3WzJM9GnHwiEcWsi7iZWcCH0P3aloZ3RSkQXe6g2RMXzx1upnHYcXdbgTRlNpSEX98dB+D7OjH8dhf2IBB6J+iYZRV3kwrf7GfzFucLjdGP4TgZfP/gaDRMVOozJsieuxcMFmz6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734843657; c=relaxed/simple; bh=dBpoTk4s8OfoXgQIHG9q+kMWzF7ACr4fOXNDIEIP2pc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uUwxgFBcwvCykAAaARxY3PlOVr0gpuqIHvOMnyFnyeOj2ZGLU3OcC+np+qoO51+LSEVWmx6kdIGpefz6D60MXUm5Dpe/T1YQR6mOtKfe62b6NS9h/mRUkaU/byQVPUJKHta8LXqBaFULgx4oJckoxqCtznHZzzMkoqaKP5a1NSk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=w4N/OPIy; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="w4N/OPIy" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-54024aa9febso3438451e87.1 for ; Sat, 21 Dec 2024 21:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734843654; x=1735448454; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SPUKe2inYvlgyzg1RdM9z6lWoAQEDWbkCd9hh5ymtmI=; b=w4N/OPIyF8ScdhmvCkfH/DXID6gzc7nz8JC2TXeihLPEqI8+WUcN9Mgnn/k84kAxzv 5DGVaJ8cWOesRLpdcx9Gl7JygNok+r9RTemo4XOIpaPurwZF01WC4c0F9jpegWwClz3d gSJPgVZH7G9x2A/BLkg8rT4sVtONreVrnwHU/ark1BhmddE7UpP+jaHbU73wCWa01bvP 5mOmriaeUjjra5lOcIGLYlQ2WmcigcZmubeEmc58Cb2tBqD5/oiMyoeCaehK4KSc+q27 AQZfcf2xkEk4MpC9WrC7K3Z7fwTODTciNhD+6SCR2cJTSuf03fC3+BTfywacuA01x/kZ njEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734843654; x=1735448454; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SPUKe2inYvlgyzg1RdM9z6lWoAQEDWbkCd9hh5ymtmI=; b=Mb3ycRWg1dWx3Do/CQ/wNDCq6hgGD4wJq8YphSk50p/vFB9Ot/d+kC/w8rsgm9qWDU 1/f2BPt4Z4Mw+ls4pt3PMZIYwI00tGPSlqUhnpi62199e9+VQkJaH7AoUfHpq9hqcvSs htYhKY2+W4XBu8Bt/RQqjGCHzUvWsywqU1BYze7nZ2bqWm+Y98FPcUvD/kByIaLOtImL e9L81qBaGPJFM4tBJKG2hKkga51cHgz3w5xgs7Jazy5ZfeCw7XzjxVL4cvQhNAATskST jzymmJBzEw84V+tGQ2uKIBEuaxdr/9X20fPVbQxoQWn32vAnJO+GA79THygl110BLavu EXqQ== X-Forwarded-Encrypted: i=1; AJvYcCVk9d5dHN+NDgk4to5gvfDcTTgwyT5JSighb1LD7aMfCuhDoBn3VfzC/qi/J3EwK8qawV4m30iW6+AkSxeO@vger.kernel.org X-Gm-Message-State: AOJu0YxfdrQayVklVTzfmdyHTdXMpuLz1661jnIRK1hqBHuJjqHEHgoW 2mILmggGpTA8cVSQxLZDH/nHtbOnWMteG47L+t0qINeFD4RbhTh0fiVWpoXYpqQ= X-Gm-Gg: ASbGncvMaMaTH3skHkVAYMC5INg10fX6r+wUDpZ/MVyZH/aFYpCNXttTs22Yg1/7+lQ 2NL+bwlKccGLAM0xnSviyUKfwGwoRNnx19p5uqc+qnS3HSDMf0qhjIYazmVchRk8qiraJV8rMy1 uNgDzC1Zp+F7G30TiEr+ju2JnDtmhM4TS0e0/tu63Iyk7y3Ihzig6Ggw/IxanVqBqX6YwLLue47 8iF/BWWFd8IejswWaUB/VnAmif/jOHoDS+jRZ2zNfPbmd/jMGSpS0rt1/0OPS28 X-Google-Smtp-Source: AGHT+IH5FngsI07NNLouagSYBk1lHP+UW7OocB95mR63hfokDbT+bvXmYWVojBL11pLAgTWk4aF61g== X-Received: by 2002:a05:6512:1392:b0:53e:38df:673d with SMTP id 2adb3069b0e04-54229562a01mr2899574e87.43.1734843654003; Sat, 21 Dec 2024 21:00:54 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54223832c05sm887145e87.276.2024.12.21.21.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 21:00:52 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 22 Dec 2024 07:00:43 +0200 Subject: [PATCH 3/6] drm/msm/dpu: don't use active in atomic_check() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241222-drm-dirty-modeset-v1-3-0e76a53eceb9@linaro.org> References: <20241222-drm-dirty-modeset-v1-0-0e76a53eceb9@linaro.org> In-Reply-To: <20241222-drm-dirty-modeset-v1-0-0e76a53eceb9@linaro.org> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Chandan Uddaraju , Jeykumar Sankaran , Jordan Crouse , Sravanthi Kollukuduru Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Archit Taneja , Rajesh Yadav , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Simona Vetter X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2196; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=dBpoTk4s8OfoXgQIHG9q+kMWzF7ACr4fOXNDIEIP2pc=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnZ5z7MZS6rAhW4DKuCWV9b4WdZ4hjqC6HLAq/i yre35Fm6UKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ2ec+wAKCRCLPIo+Aiko 1YNhB/9hX2wrzJFQ1fwM8icQeBER9azSe4PG8Bpkhfz75DieLiutJPwRQtpOItU+qWqg6WCbESd AFhW4a8ggukt6IuqRscFxzbxnfStjAf2/AAxGGiUjRKmbegN4evvPH5ZuwMVRYHJipxbUjM5dRq DY26GP4KUxfZcN4d8cap0cnUgNxEWBohuAcKFyOWCgnSxUgNoKTOVPzAbLRB/+eOClO0t8tg8lG mu7U1WhfrEEKB7DCcQOb4GQxWfGAazde4EKF39I9VOy3jDXwpFEdA8wWS7KB8Dd6qh4K2Qf6Lmm ngCcXoIiCtGuHQpeqXSzY8TZe2MPU/nrQD2jLanaCowQhYyE X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The driver isn't supposed to consult crtc_state->active/active_check for resource allocation. Instead all resources should be allocated if crtc_state->enabled is set. Stop consulting active / active_changed in order to determine whether the hardware resources should be (re)allocated. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Reported-by: Simona Vetter Closes: https://lore.kernel.org/dri-devel/ZtW_S0j5AEr4g0QW@phenom.ffwll.local/ Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 ---- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 7191b1a6d41b3a96f956d199398f12b2923e8c82..65e33eba61726929b740831c95330756b2817e28 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -1264,10 +1264,6 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, DRM_DEBUG_ATOMIC("%s: check\n", dpu_crtc->name); - /* force a full mode set if active state changed */ - if (crtc_state->active_changed) - crtc_state->mode_changed = true; - if (cstate->num_mixers) { rc = _dpu_crtc_check_and_setup_lm_bounds(crtc, crtc_state); if (rc) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 83de7564e2c1fe14fcf8c4f82335cafc937e1b99..d1ccdca6044353f110bf5b507788efe368f223a3 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -793,12 +793,11 @@ static int dpu_encoder_virt_atomic_check( crtc_state->mode_changed = true; /* * Release and Allocate resources on every modeset - * Dont allocate when active is false. */ if (drm_atomic_crtc_needs_modeset(crtc_state)) { dpu_rm_release(global_state, drm_enc); - if (!crtc_state->active_changed || crtc_state->enable) + if (crtc_state->enable) ret = dpu_rm_reserve(&dpu_kms->rm, global_state, drm_enc, crtc_state, topology); if (!ret) From patchwork Sun Dec 22 05:00:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 852966 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA88A16C684 for ; Sun, 22 Dec 2024 05:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734843661; cv=none; b=Sv8qFmN3u+WL7/Y3abl9gdv+2I2oVwRBM06QX/COBvoeTEbx570K6Fpd0GmHKbnIAb6FQWg+vrbvy0IL4ggYh5pv8MdNn0HjovQU6pPw0TIHvle/DRyjZ8qzZr0uVh+iKuOnFGfe2BrtEWy4xibtvFoUJc7rMQEBEAPYcJDLX4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734843661; c=relaxed/simple; bh=SDNJAbezzZSsnq7fpawYXa2xRvPpUEjnL/Cth4qzNd8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BbKWBI7ZiLL4snmhsHlKH27mJTzXlRBiDq8lTYsHIYozxHTjBDZ4rKI6ExoPYXMVRmqFYsgJRlxnmMvzRmPDlZsVmgJHaz9O9OOIWYpxRu2aiURcQKtws162bVTCGVD5euJnx20eI8P8ndStjmnu5WgM5QYKcA9wkyqBm5Yjo7Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=EjJHGDXl; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EjJHGDXl" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-53e399e3310so3626537e87.1 for ; Sat, 21 Dec 2024 21:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734843658; x=1735448458; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1PPE+DKsFPu1B8MZdgtx/UyAZ7+JrfrkZtB47k/Sbl8=; b=EjJHGDXls7MJoxyFa9LE7FLh4wjhlktH1/1EIDLljwK4bQvRvy+TPhg8MGiP2qXoT/ twRtSZGBGFph3gTj1ihC4bIfphLImmJDPVGW3x2oDm9SyrCNt+DYSphwsRMVxrlIS4Bm 2TpAboZKBoFV8HgyhnynDifwrRe7NTFi22EwXkpDevfEctZ1OAoBwevBgeVgWXkIw+Ow RQh4ZHllWNE92aD+tBhy0cVZhRGl6cnP77O8YJ4wySsM+em26aeXH6+qYAQpFObL3YjP i8nGRiSUk5AwFW/ga+dG6i3CHzHRgkFOcKap3WsmWN06vC0mua/bS7ds/2u6i9Nhfsbr XWkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734843658; x=1735448458; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1PPE+DKsFPu1B8MZdgtx/UyAZ7+JrfrkZtB47k/Sbl8=; b=DLqQNXNowptXrb/KOEl4tlE6s+UvaMPmxfSEAlIYrTJcntQq59o8Ikf0aBf8Y8EUNF 7A2gFsp5o42OLJ8fXYijd1lEIkPugYGWMWcamDvmolkRU1RUmGvCdcsaXvAsOJsdX18B q298/MbEZsfYBPha/lWhNURxXGeztCV5YMAGTyuNQB6zKX8zAJbJefOnKte3/Ots7Q6Z ZpLzRsYDRV/j1nsKb8ngC3/LThNMT3ipc1CCFB74UDTsgr9ixZ0Q9RCi938FL8lKStxb 3rQwj+h2kOW5qB5Fyoe3YTBlh6SAJEQX8eCd2lZpeuVo1SvH93ph0JFW6JWg6zqo//y4 cCGA== X-Forwarded-Encrypted: i=1; AJvYcCWNKoPGP5Cc4ceVZfSRzpeDYV1Wox5hMf4nv+w4emOU+EfSPf18TsGCilqnQrKpFjlA3IPQipDhog7AHvQn@vger.kernel.org X-Gm-Message-State: AOJu0Yz1HVRwt7V+heY//fmx2qAWVk+niFsVkZIMYCy2p8rpGr2sQP3S Wi8YBIQmPFdpn0G9vefSKbCRSNgvFlOawVzTJ/zpIY5W+kWlplLzNc51y8WOflc= X-Gm-Gg: ASbGncuQeBLJn5yst1OIxRi/ERi36psGC0RmdZ2v9EfNh5gqHbZCREhi47yJ31TKiAR YSpTz8mNsGM1r7af+LoLeAHi/yXc3/TBzMlQJYcJiUFxo061Vnzl+omKvQCZzklTuUZsvrSC/rh Y3WrE06ubtwFbPTf1xow/EbYmpb8jQoRt0dGKwfMJ3e5G65sYbNnsMzHIy+UatDZ5njXZWvETtQ 0GJDN6hp3CL67oH88MJE6CK2cDkpnbvutZqN9KRVEgKQpRHMVslJUHJYg+R/v9u X-Google-Smtp-Source: AGHT+IH+eDvaVhNnPNnX4zWTkXTtQclana7wLSRQrkIgq8aEDb+XrV3w0l4HgTPorE4qdZ+Lvklo7Q== X-Received: by 2002:a05:6512:1594:b0:540:25a6:c390 with SMTP id 2adb3069b0e04-542295302ebmr2158713e87.23.1734843657997; Sat, 21 Dec 2024 21:00:57 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54223832c05sm887145e87.276.2024.12.21.21.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 21:00:56 -0800 (PST) From: Dmitry Baryshkov Date: Sun, 22 Dec 2024 07:00:45 +0200 Subject: [PATCH 5/6] drm/msm/dpu: simplify dpu_encoder_get_topology() interface Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241222-drm-dirty-modeset-v1-5-0e76a53eceb9@linaro.org> References: <20241222-drm-dirty-modeset-v1-0-0e76a53eceb9@linaro.org> In-Reply-To: <20241222-drm-dirty-modeset-v1-0-0e76a53eceb9@linaro.org> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Chandan Uddaraju , Jeykumar Sankaran , Jordan Crouse , Sravanthi Kollukuduru Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Archit Taneja , Rajesh Yadav , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Simona Vetter X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2208; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=SDNJAbezzZSsnq7fpawYXa2xRvPpUEjnL/Cth4qzNd8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnZ5z71T2yv4R9UPEPMcmIkEaIwmjnLl7Y7eQrO nscMp6Tu6SJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ2ec+wAKCRCLPIo+Aiko 1duyB/4rfKOpjGWq0scuzKBQewFm9Dx24jvzo3P+DhpeytyRxLzingB/T0inzmmrQOQpwKiWfio D0jnRNBHfATPbKdu4OiS6Ki+k+1wH8XzuaK9H1/7DYTAWvssLTPZf+ICqjiMg1/fMVvGUEPforl 6todMfQE7PWAwSCBq+AvLLppjwzKnr4LPlvWprhU0JjkJameNpPMoYw75JklyVFZF52HgKktBdE 4YvP3+1DV8EVV2PLOTBqbI5FiINVobD2NbQUdj2uOWPN0/K5NOgiPeFbIb24a52wyKwcbO7XIg1 IkHrr/ZnBzUs4KQ3Rza6ZJjqFgfe+2R46XD4LIAeqHeJh8G0 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A As a preparation for calling dpu_encoder_get_topology() from different code paths, simplify its calling interface, obtaining some data pointers internally instead passing them via arguments. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 88690191a9c9485e052d37749d1b61f50328916e..209e6fb605b2d8724935b62001032e7d39540366 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -649,14 +649,14 @@ struct drm_dsc_config *dpu_encoder_get_dsc_config(struct drm_encoder *drm_enc) static struct msm_display_topology dpu_encoder_get_topology( struct dpu_encoder_virt *dpu_enc, - struct dpu_kms *dpu_kms, struct drm_display_mode *mode, struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state, - struct drm_dsc_config *dsc) + struct drm_connector_state *conn_state) { struct msm_drm_private *priv = dpu_enc->base.dev->dev_private; struct msm_display_info *disp_info = &dpu_enc->disp_info; + struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms); + struct drm_dsc_config *dsc = dpu_encoder_get_dsc_config(&dpu_enc->base); struct msm_display_topology topology = {0}; int i, intf_count = 0; @@ -764,7 +764,6 @@ static int dpu_encoder_virt_atomic_check( struct drm_display_mode *adj_mode; struct msm_display_topology topology; struct dpu_global_state *global_state; - struct drm_dsc_config *dsc; int ret = 0; if (!drm_enc || !crtc_state || !conn_state) { @@ -785,10 +784,7 @@ static int dpu_encoder_virt_atomic_check( trace_dpu_enc_atomic_check(DRMID(drm_enc)); - dsc = dpu_encoder_get_dsc_config(drm_enc); - - topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state, conn_state, - dsc); + topology = dpu_encoder_get_topology(dpu_enc, adj_mode, crtc_state, conn_state); if (topology.needs_cdm && !dpu_enc->cur_master->hw_cdm) crtc_state->mode_changed = true;