From: Lyude Paul <lyude@redhat.com>
To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: Faith Ekstrand <faith.ekstrand@collabora.com>,
Dave Airlie <airlied@redhat.com>,
Leandro Ribeiro <leandro.ribeiro@collabora.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Kees Cook <kees@kernel.org>,
Marco Crivellari <marco.crivellari@suse.com>,
Simona Vetter <simona@ffwll.ch>,
Pekka Paalanen <pekka.paalanen@collabora.com>,
Maxime Ripard <mripard@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Daniel Stone <daniels@collabora.com>
Subject: [PATCH v2 1/3] drm/nouveau/kms/nv50-: Add .blend_modes to nv50_wndw_func
Date: Mon, 20 Jul 2026 16:43:55 -0400 [thread overview]
Message-ID: <20260720205541.257781-2-lyude@redhat.com> (raw)
In-Reply-To: <20260720205541.257781-1-lyude@redhat.com>
At the moment, we currently (incorrectly) only expose a blend property on
the plane if we have a nv50_wndw_func->blend_set function for the given
wndw type. But we need to expose a blend property for all types of planes
that can display color formats with an alpha channel.
Prepare for doing this by introducing a way of looking up the supported
blend modes for a type of wndw by introducing .blend_modes, which describes
all possible blending modes nouveau currently supports for a type of wndw.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
---
drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 3 +++
drivers/gpu/drm/nouveau/dispnv50/wndw.h | 10 ++++++++++
drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 1 +
drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c | 1 +
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c | 1 +
drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c | 1 +
6 files changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
index 1a889139cb053..5f2ff40388e7f 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
@@ -29,6 +29,7 @@
#include <nvhw/class/cl507a.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
#include <drm/drm_fourcc.h>
bool
@@ -164,6 +165,8 @@ curs507a_wndw = {
.acquire = curs507a_acquire,
.release = curs507a_release,
.prepare = curs507a_prepare,
+ // TODO: Cursors also support premulti, but we haven't hooked it up anywhere yet.
+ .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
};
int
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h b/drivers/gpu/drm/nouveau/dispnv50/wndw.h
index 90d100514bef2..81af5c3369d4c 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndw.h
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.h
@@ -1,6 +1,8 @@
#ifndef __NV50_KMS_WNDW_H__
#define __NV50_KMS_WNDW_H__
#define nv50_wndw(p) container_of((p), struct nv50_wndw, plane)
+#include <drm/drm_blend.h>
+
#include "disp.h"
#include "atom.h"
#include "lut.h"
@@ -74,6 +76,7 @@ struct nv50_wndw_func {
int (*image_clr)(struct nv50_wndw *);
int (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
int (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
+ unsigned int blend_modes;
int (*update)(struct nv50_wndw *, u32 *interlock);
};
@@ -139,4 +142,11 @@ int wndwca7e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
struct nv50_wndw **);
+
+/* A set of blend modes supported by all wndws */
+#define WNDW_BLEND_MODES \
+ BIT(DRM_MODE_BLEND_COVERAGE) \
+ | BIT(DRM_MODE_BLEND_PREMULTI) \
+ | BIT(DRM_MODE_BLEND_PIXEL_NONE)
+
#endif
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c
index 554c4f91f8bec..7ab4d532118ee 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c
@@ -343,6 +343,7 @@ wndwc37e = {
.image_set = wndwc37e_image_set,
.image_clr = wndwc37e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
index d1ca51aae58cd..e220f43b5bca7 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
@@ -231,6 +231,7 @@ wndwc57e = {
.image_set = wndwc57e_image_set,
.image_clr = wndwc37e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c
index 52af293c98f4a..580cf7abd8193 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c
@@ -95,6 +95,7 @@ wndwc67e = {
.image_set = wndwc67e_image_set,
.image_clr = wndwc37e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c
index 2cec8cfbd5461..d65ec438b434f 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c
@@ -231,6 +231,7 @@ wndwca7e = {
.image_set = wndwca7e_image_set,
.image_clr = wndwca7e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
--
2.55.0
WARNING: multiple messages have this Message-ID (diff)
From: Lyude Paul <lyude@redhat.com>
To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: "Faith Ekstrand" <faith.ekstrand@collabora.com>,
"Dave Airlie" <airlied@redhat.com>,
"Leandro Ribeiro" <leandro.ribeiro@collabora.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Kees Cook" <kees@kernel.org>,
"Marco Crivellari" <marco.crivellari@suse.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Pekka Paalanen" <pekka.paalanen@collabora.com>,
"David Airlie" <airlied@gmail.com>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Maxime Ripard" <mripard@kernel.org>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Stone" <daniels@collabora.com>,
"James Jones" <jajones@nvidia.com>,
"Lyude Paul" <lyude@redhat.com>
Subject: [PATCH v2 1/3] drm/nouveau/kms/nv50-: Add .blend_modes to nv50_wndw_func
Date: Mon, 20 Jul 2026 16:43:55 -0400 [thread overview]
Message-ID: <20260720205541.257781-2-lyude@redhat.com> (raw)
In-Reply-To: <20260720205541.257781-1-lyude@redhat.com>
At the moment, we currently (incorrectly) only expose a blend property on
the plane if we have a nv50_wndw_func->blend_set function for the given
wndw type. But we need to expose a blend property for all types of planes
that can display color formats with an alpha channel.
Prepare for doing this by introducing a way of looking up the supported
blend modes for a type of wndw by introducing .blend_modes, which describes
all possible blending modes nouveau currently supports for a type of wndw.
Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
---
drivers/gpu/drm/nouveau/dispnv50/curs507a.c | 3 +++
drivers/gpu/drm/nouveau/dispnv50/wndw.h | 10 ++++++++++
drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c | 1 +
drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c | 1 +
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c | 1 +
drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c | 1 +
6 files changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
index 1a889139cb053..5f2ff40388e7f 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
@@ -29,6 +29,7 @@
#include <nvhw/class/cl507a.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
#include <drm/drm_fourcc.h>
bool
@@ -164,6 +165,8 @@ curs507a_wndw = {
.acquire = curs507a_acquire,
.release = curs507a_release,
.prepare = curs507a_prepare,
+ // TODO: Cursors also support premulti, but we haven't hooked it up anywhere yet.
+ .blend_modes = BIT(DRM_MODE_BLEND_COVERAGE),
};
int
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h b/drivers/gpu/drm/nouveau/dispnv50/wndw.h
index 90d100514bef2..81af5c3369d4c 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndw.h
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.h
@@ -1,6 +1,8 @@
#ifndef __NV50_KMS_WNDW_H__
#define __NV50_KMS_WNDW_H__
#define nv50_wndw(p) container_of((p), struct nv50_wndw, plane)
+#include <drm/drm_blend.h>
+
#include "disp.h"
#include "atom.h"
#include "lut.h"
@@ -74,6 +76,7 @@ struct nv50_wndw_func {
int (*image_clr)(struct nv50_wndw *);
int (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
int (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
+ unsigned int blend_modes;
int (*update)(struct nv50_wndw *, u32 *interlock);
};
@@ -139,4 +142,11 @@ int wndwca7e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
struct nv50_wndw **);
+
+/* A set of blend modes supported by all wndws */
+#define WNDW_BLEND_MODES \
+ BIT(DRM_MODE_BLEND_COVERAGE) \
+ | BIT(DRM_MODE_BLEND_PREMULTI) \
+ | BIT(DRM_MODE_BLEND_PIXEL_NONE)
+
#endif
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c
index 554c4f91f8bec..7ab4d532118ee 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc37e.c
@@ -343,6 +343,7 @@ wndwc37e = {
.image_set = wndwc37e_image_set,
.image_clr = wndwc37e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
index d1ca51aae58cd..e220f43b5bca7 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
@@ -231,6 +231,7 @@ wndwc57e = {
.image_set = wndwc57e_image_set,
.image_clr = wndwc37e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c
index 52af293c98f4a..580cf7abd8193 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c
@@ -95,6 +95,7 @@ wndwc67e = {
.image_set = wndwc67e_image_set,
.image_clr = wndwc37e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c
index 2cec8cfbd5461..d65ec438b434f 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwca7e.c
@@ -231,6 +231,7 @@ wndwca7e = {
.image_set = wndwca7e_image_set,
.image_clr = wndwca7e_image_clr,
.blend_set = wndwc37e_blend_set,
+ .blend_modes = WNDW_BLEND_MODES,
.update = wndwc37e_update,
};
--
2.55.0
next prev parent reply other threads:[~2026-07-20 20:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 20:43 [PATCH v2 0/3] drm/nouveau: Fix WARN_ON() from missing blend modes Lyude Paul
2026-07-20 20:43 ` Lyude Paul
2026-07-20 20:43 ` Lyude Paul [this message]
2026-07-20 20:43 ` [PATCH v2 1/3] drm/nouveau/kms/nv50-: Add .blend_modes to nv50_wndw_func Lyude Paul
2026-07-20 21:06 ` sashiko-bot
2026-07-20 20:43 ` [PATCH v2 2/3] drm/nouveau/kms/nv50-: Introduce nv50_wndw_default_state() Lyude Paul
2026-07-20 20:43 ` Lyude Paul
2026-07-20 21:08 ` sashiko-bot
2026-07-20 20:43 ` [PATCH v2 3/3] drm/nouveau/kms/nv50-: Unconditionally create blend_mode prop for wndws Lyude Paul
2026-07-20 20:43 ` Lyude Paul
2026-07-20 21:15 ` sashiko-bot
2026-07-21 20:21 ` lyude
2026-07-21 20:08 ` [PATCH v2 0/3] drm/nouveau: Fix WARN_ON() from missing blend modes lyude
2026-07-21 20:08 ` lyude
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=20260720205541.257781-2-lyude@redhat.com \
--to=lyude@redhat.com \
--cc=airlied@redhat.com \
--cc=dakr@kernel.org \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith.ekstrand@collabora.com \
--cc=kees@kernel.org \
--cc=leandro.ribeiro@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marco.crivellari@suse.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=pekka.paalanen@collabora.com \
--cc=simona@ffwll.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.