Re: [PATCH] drm/qxl: fix NULL dereference in qxl_add_mode

2024-03-01 Thread Gerd Hoffmann
On Fri, Mar 01, 2024 at 11:55:11AM +0300, Aleksandr Burakov wrote: > Return value of a function 'drm_cvt_mode' is dereferenced without > checking for NULL but drm_mode_create() in drm_cvt_mode() may > return NULL value in case of memory allocation error. > > Found by Linux Verification Center (lin

Re: [PATCH 00/13] drm: Fix reservation locking for pin/unpin and console

2024-03-01 Thread Dmitry Osipenko
On 2/28/24 11:19, Thomas Zimmermann wrote: > Hi > > Am 27.02.24 um 19:14 schrieb Dmitry Osipenko: >> Hello, >> >> Thank you for the patches! >> >> On 2/27/24 13:14, Thomas Zimmermann wrote: >>> Dma-buf locking semantics require the caller of pin and unpin to hold >>> the buffer's reservation lock.

[PATCH v2] drm/qxl: fix NULL dereference in qxl_add_mode

2024-03-01 Thread Aleksandr Burakov
Return value of a function 'drm_cvt_mode' is dereferenced without checking for NULL but drm_mode_create() in drm_cvt_mode() may return NULL value in case of memory allocation error. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode h

[PATCH] drm/qxl: fix NULL dereference in qxl_add_mode

2024-03-01 Thread Aleksandr Burakov
Return value of a function 'drm_cvt_mode' is dereferenced without checking for NULL but drm_mode_create() in drm_cvt_mode() may return NULL value in case of memory allocation error. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode h

[PATCH v5 1/5] dcc: Check to see if the client supports multiple codecs (v2)

2024-03-01 Thread Vivek Kasireddy
We need to determine if the client is new enough to support multiple codecs -- which might include any of the Gstreamer based ones. v2: (suggestions and fixups from Frediano) - Add is_gl_client() method to DisplayChannelClient instead of a dcc_is_gl_client() function. - Avoid the usage of XXX_CA

[PATCH v5 3/5] dcc-send: Encode and send gl_draw stream data to the remote client (v3)

2024-03-01 Thread Vivek Kasireddy
For remote (or non-gl) clients, if a valid gl_draw stream exists, then we first extract the dmabuf fd associated with the scanout and share it with the encoder along with other key parameters such as stride, width and height. Once the encoder finishes creating an encoded buffer (using the dmabuf fd

[PATCH v5 5/5] video-stream: Don't stop a stream associated with gl_draw (v2)

2024-03-01 Thread Vivek Kasireddy
We do not want to stop a stream associated with gl_draw as a result of timeout because we may not get another opportunity to create a new stream if the current one gets stopped. However, when the stream does get stopped for other reasons, we need to clear the gl_draw_stream pointer associated with

[PATCH v5 4/5] gstreamer-encoder: Add an encoder function that takes dmabuf fd as input (v3)

2024-03-01 Thread Vivek Kasireddy
This patch adds a new function to enable the creation of Gst memory with the dmabuf fd as the source by using a dmabuf allocator. And, it also adds a mechanism to register and invoke any callbacks once the Gst memory object is no longer used by the pipeline. This patch also ensures that the source

[PATCH v5 2/5] dcc: Create a stream associated with gl_draw for non-gl clients (v4)

2024-03-01 Thread Vivek Kasireddy
For non-gl/remote clients, if there is no stream associated with the DisplayChannel, then we create a new stream. Otherwise, we just update the current stream's timestamp. v2: (suggestions and fixups from Frediano) - Moved the gl_draw_stream object from DCC to DC - Moved the stream initialization

[PATCH v5 0/5] dcc: Create a stream for non-gl/remote clients that want to use dmabuf (v5)

2024-03-01 Thread Vivek Kasireddy
For clients that cannot accept a dmabuf fd directly (such as those running on a remote system), this patch series provides a way for the Spice server to stream the gl/dmabuf data/buffer instead. This is mostly done by enabling the creation of Gst memory using a dmabuf fd as the source. This ability