From: Louis Chauvet <louis.chauvet@bootlin.com>
To: "Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
"Melissa Wen" <melissa.srw@gmail.com>,
"Maíra Canal" <mairacanal@riseup.net>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Jonathan Corbet" <corbet@lwn.net>,
rdunlap@infradead.org, arthurgrillo@riseup.net,
pekka.paalanen@haloniitty.fi
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, jeremie.dautheribes@bootlin.com,
miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
seanpaul@google.com, marcheu@google.com,
nicolejadeyee@google.com,
Louis Chauvet <louis.chauvet@bootlin.com>,
Pekka Paalanen <pekka.paalanen@collabora.com>
Subject: [PATCH v9 05/17] drm/vkms: Add dummy pixel_read/pixel_write callbacks to avoid NULL pointers
Date: Fri, 02 Aug 2024 18:09:50 +0200 [thread overview]
Message-ID: <20240802-yuv-v9-5-08a706669e16@bootlin.com> (raw)
In-Reply-To: <20240802-yuv-v9-0-08a706669e16@bootlin.com>
Introduce two callbacks which does nothing. They are used in replacement
of NULL and it avoid kernel OOPS if this NULL is called.
If those callback are used, it means that there is a mismatch between
what formats are announced by atomic_check and what is realy supported by
atomic_update.
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
drivers/gpu/drm/vkms/vkms_formats.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
index 5ebc691656bc..ecbe79f8dfdc 100644
--- a/drivers/gpu/drm/vkms/vkms_formats.c
+++ b/drivers/gpu/drm/vkms/vkms_formats.c
@@ -135,6 +135,7 @@ static void RGB565_to_argb_u16(u8 *in_pixel, struct pixel_argb_u16 *out_pixel)
out_pixel->b = drm_fixp2int_round(drm_fixp_mul(fp_b, fp_rb_ratio));
}
+
/**
* vkms_compose_row - compose a single row of a plane
* @stage_buffer: output line with the composed pixels
@@ -260,8 +261,10 @@ void vkms_writeback_row(struct vkms_writeback_job *wb,
/**
* get_pixel_conversion_function() - Retrieve the correct read_pixel function for a specific
- * format. The returned pointer is NULL for unsupported pixel formats. The caller must ensure that
- * the pointer is valid before using it in a vkms_plane_state.
+ * format.
+ *
+ * If the format is not supported by VKMS a warning is emitted and a dummy "always read magenta"
+ * function is returned.
*
* @format: DRM_FORMAT_* value for which to obtain a conversion function (see [drm_fourcc.h])
*/
@@ -293,8 +296,8 @@ pixel_read_t get_pixel_read_function(u32 format)
/**
* get_pixel_write_function() - Retrieve the correct write_pixel function for a specific format.
- * The returned pointer is NULL for unsupported pixel formats. The caller must ensure that the
- * pointer is valid before using it in a vkms_writeback_job.
+ * If the format is not supported by VKMS a warning is emitted and a dummy "don't do anything"
+ * function is returned.
*
* @format: DRM_FORMAT_* value for which to obtain a conversion function (see [drm_fourcc.h])
*/
--
2.44.2
next prev parent reply other threads:[~2024-08-02 16:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 16:09 [PATCH v9 00/17] drm/vkms: Reimplement line-per-line pixel conversion for plane reading Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 01/17] drm/vkms: Code formatting Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 02/17] drm/vkms: Use drm_frame directly Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 03/17] drm/vkms: write/update the documentation for pixel conversion and pixel write functions Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 04/17] drm/vkms: Add typedef and documentation for pixel_read and pixel_write functions Louis Chauvet
2024-08-02 16:09 ` Louis Chauvet [this message]
2024-08-02 16:09 ` [PATCH v9 06/17] drm/vkms: Use const for input pointers in pixel_read an " Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 07/17] drm/vkms: Update pixels accessor to support packed and multi-plane formats Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 08/17] drm/vkms: Avoid computing blending limits inside pre_mul_alpha_blend Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 09/17] drm/vkms: Introduce pixel_read_direction enum Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 10/17] drm/vkms: Re-introduce line-per-line composition algorithm Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 11/17] drm/vkms: Remove useless drm_rotation_simplify Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 12/17] drm/vkms: Add YUV support Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 13/17] drm/vkms: Add range and encoding properties to the plane Louis Chauvet
2024-08-02 16:09 ` [PATCH v9 14/17] drm/vkms: Drop YUV formats TODO Louis Chauvet
2024-08-02 16:10 ` [PATCH v9 15/17] drm/vkms: Create KUnit tests for YUV conversions Louis Chauvet
2024-08-05 17:09 ` Jeff Johnson
2024-08-02 16:10 ` [PATCH v9 16/17] drm/vkms: Add how to run the Kunit tests Louis Chauvet
2024-08-02 16:10 ` [PATCH v9 17/17] drm/vkms: Add support for DRM_FORMAT_R* Louis Chauvet
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=20240802-yuv-v9-5-08a706669e16@bootlin.com \
--to=louis.chauvet@bootlin.com \
--cc=airlied@gmail.com \
--cc=arthurgrillo@riseup.net \
--cc=corbet@lwn.net \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=jeremie.dautheribes@bootlin.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mairacanal@riseup.net \
--cc=marcheu@google.com \
--cc=melissa.srw@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=mripard@kernel.org \
--cc=nicolejadeyee@google.com \
--cc=pekka.paalanen@collabora.com \
--cc=pekka.paalanen@haloniitty.fi \
--cc=rdunlap@infradead.org \
--cc=rodrigosiqueiramelo@gmail.com \
--cc=seanpaul@google.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®