From: Harry Wentland <harry.wentland@amd.com>
To: Melissa Wen <mwen@igalia.com>,
airlied@gmail.com, alexander.deucher@amd.com, alex.hung@amd.com,
aurabindo.pillai@amd.com, christian.koenig@amd.com,
contact@emersion.fr, daniels@collabora.com,
louis.chauvet@bootlin.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, sebastian.wick@redhat.com, simona@ffwll.ch,
siqueira@igalia.com, sunpeng.li@amd.com, tzimmermann@suse.de
Cc: Uma Shankar <uma.shankar@intel.com>,
Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
Xaver Hugl <xaver.hugl@kde.org>,
Pekka Paalanen <pekka.paalanen@collabora.com>,
Matthew Schwartz <matthew.schwartz@linux.dev>,
amd-gfx@lists.freedesktop.org, kernel-dev@igalia.com,
Rob Clark <robin.clark@oss.qualcomm.com>,
Dmitry Baryshkov <lumag@kernel.org>, Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
Sashiko <sashiko-bot@kernel.org>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 09/11] drm/amd/display: don't ignore failure on blend colorop setup
Date: Wed, 30 Sep 2026 15:38:06 -0400 [thread overview]
Message-ID: <dd7a424f-c6bb-4fc2-8738-c969541aec94@amd.com> (raw)
In-Reply-To: <20260811171011.184964-10-mwen@igalia.com>
On 2026-08-11 12:45, Melissa Wen wrote:
> __set_input_tf_32() can fail on ENOMEM and let the blend transfer
> function setup in an unstable state. Check its return value and only
> enable blend if transfer function was successfully configured.
>
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Fixes: 5ed78b44e4e6 ("drm/amd/display: add shaper and blend colorops for 1D Curve Custom LUT")
> Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> .../drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> index ad67106c6435..c528daefac5e 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> @@ -1835,7 +1835,7 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state,
> const struct drm_color_lut32 *blend_lut = NULL;
> struct drm_device *dev = colorop->dev;
> uint32_t blend_size = 0;
> - int i = 0;
> + int i = 0, ret;
>
> tf->type = TF_TYPE_BYPASS;
> dc_plane_state->cm.flags.bits.blend_enable = 0;
> @@ -1870,8 +1870,10 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state,
> tf->type = TF_TYPE_DISTRIBUTED_POINTS;
> tf->tf = default_tf = amdgpu_colorop_tf_to_dc_tf(tf_state->curve_1d_type);
> tf->sdr_ref_white_level = SDR_WHITE_LEVEL_INIT_VALUE;
> + ret = __set_input_tf_32(NULL, tf, blend_lut, blend_size);
> + if (ret)
> + return ret;
> dc_plane_state->cm.flags.bits.blend_enable = 1;
> - __set_input_tf_32(NULL, tf, blend_lut, blend_size);
> }
>
> if (lut_state && !lut_state->bypass) {
> @@ -1879,13 +1881,16 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state,
> tf->type = TF_TYPE_DISTRIBUTED_POINTS;
> tf->tf = default_tf;
> tf->sdr_ref_white_level = SDR_WHITE_LEVEL_INIT_VALUE;
> - dc_plane_state->cm.flags.bits.blend_enable = 1;
> blend_lut = __extract_blob_lut32(lut_state->data, &blend_size);
> blend_size = blend_lut != NULL ? blend_size : 0;
>
> /* Custom LUT size must be the same as supported size */
> - if (blend_size == lut_colorop->size)
> - __set_input_tf_32(NULL, tf, blend_lut, blend_size);
> + if (blend_size == lut_colorop->size) {
> + ret = __set_input_tf_32(NULL, tf, blend_lut, blend_size);
> + if (ret)
> + return ret;
> + dc_plane_state->cm.flags.bits.blend_enable = 1;
> + }
> }
>
> return 0;
next prev parent reply other threads:[~2026-09-30 19:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 16:45 [PATCH v4 00/11] drm/atomic: don't allow changes to inactive colorops & other fixes Melissa Wen
2026-08-11 16:45 ` [PATCH v4 01/11] drm/atomic: only add states of active or transient active colorops Melissa Wen
2026-09-30 19:11 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 02/11] drm/atomic: reject colorop update from inactive color pipeline Melissa Wen
2026-09-30 19:18 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 03/11] drm/atomic: duplicate state of all colorops Melissa Wen
2026-09-30 19:20 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 04/11] drm/atomic: check if an active colorop has a blob if its type requires one Melissa Wen
2026-09-30 19:25 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 05/11] drm/amd/display: only check colorops of an active color pipeline Melissa Wen
2026-09-30 19:32 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 06/11] drm/amd/display: truly bypass plane colorop 3x4 matrix and hdr mult Melissa Wen
2026-09-30 19:34 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 07/11] drm/amd/display: make shaper bypass mode cleaner Melissa Wen
2026-09-30 19:35 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 08/11] drm/amd/display: make blnd bypass mode clearer Melissa Wen
2026-09-30 19:36 ` Harry Wentland
2026-08-11 16:45 ` [PATCH v4 09/11] drm/amd/display: don't ignore failure on blend colorop setup Melissa Wen
2026-09-30 19:38 ` Harry Wentland [this message]
2026-08-11 16:45 ` [PATCH v4 10/11] drm/amd/display: allow individual colorop changes Melissa Wen
2026-09-30 20:57 ` Harry Wentland
2026-08-11 16:46 ` [PATCH v4 11/11] drm/amd/display: distinguish colorop setup error from no colorop support Melissa Wen
2026-09-30 20:23 ` Harry Wentland
2026-08-11 18:19 ` ✗ Fi.CI.BUILD: failure for drm/atomic: don't allow changes to inactive colorops & other fixes Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dd7a424f-c6bb-4fc2-8738-c969541aec94@amd.com \
--to=harry.wentland@amd.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=christian.koenig@amd.com \
--cc=contact@emersion.fr \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marijn.suijten@somainline.org \
--cc=matthew.schwartz@linux.dev \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=pekka.paalanen@collabora.com \
--cc=robin.clark@oss.qualcomm.com \
--cc=sashiko-bot@kernel.org \
--cc=sean@poorly.run \
--cc=sebastian.wick@redhat.com \
--cc=simona@ffwll.ch \
--cc=siqueira@igalia.com \
--cc=sunpeng.li@amd.com \
--cc=tzimmermann@suse.de \
--cc=uma.shankar@intel.com \
--cc=xaver.hugl@kde.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox