drm/udl: Implementation of atomic cursor drm_plane
Subsystems (3)
This brings cursor on DisplayLink USB2.0 device on ChromeOS compositor that requires either crtc'c cursor_set callback or cursor drm_plane. Patch was tested on ChromeOS and Ubuntu 22.04 with Gnome/Wayland
PATCH 1/4 drm/udl: Port CrOS cursor blending on primary plane in usb transfer
From: Douglas Anderson <[email protected]>
Port applicable parts of CrOS udl cursor implementation from 5.4 CrOS kernel fork.
- removed legacy non-atomic udl_cursor_move, udl_cursor_set ioctl's implementation
- modified udl_cursor_download to copy cursor content to the buffer from iosys_map
- removed unnecessary cursor copy in udl_handle_damage
- simplify code by making struct udl_cursor public
Cursor was tested on ChromeOS and Ubuntu 22.04 with gnome-wayland.
(cherry picked from commit efb4c23afa3e1de185a1a4f8ff5b7ec412aec0fe) ChromiumOS fork at https://chromium.googlesource.com/chromiumos/third_party/kernel)
--- drivers/gpu/drm/udl/Makefile | 2 +- drivers/gpu/drm/udl/udl_cursor.c | 78 ++++++++++++++++++++++++++++++ drivers/gpu/drm/udl/udl_cursor.h | 47 ++++++++++++++++++ drivers/gpu/drm/udl/udl_drv.h | 6 ++- drivers/gpu/drm/udl/udl_modeset.c | 9 +++- drivers/gpu/drm/udl/udl_transfer.c | 36 +++++++++++++- 6 files changed, 173 insertions(+), 5 deletions(-) create mode 100644 drivers/gpu/drm/udl/udl_cursor.c create mode 100644 drivers/gpu/drm/udl/udl_cursor.h
drivers/gpu/drm/udl/Makefile +1 -1
@@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -udl-y := udl_drv.o udl_modeset.o udl_main.o udl_transfer.o +udl-y := udl_drv.o udl_modeset.o udl_main.o udl_transfer.o udl_cursor.o obj-$(CONFIG_DRM_UDL) := udl.o
drivers/gpu/drm/udl/udl_cursor.c new file +78 -0
78 lines not on this page · raw message
drivers/gpu/drm/udl/udl_cursor.h new file +47 -0
47 lines not on this page · raw message
drivers/gpu/drm/udl/udl_drv.h +5 -1
@@ -21,6 +21,7 @@#include <drm/drm_framebuffer.h> #include <drm/drm_gem.h> #include <drm/drm_plane.h> +#include "udl_cursor.h" struct drm_mode_create_dumb ;
@@ -60,6 +61,7 @@ static inline struct udl_connector *to_udl_connector(struct drm_connector *conne return container_of(connector, struct udl_connector, connector); } +struct udl_cursor_hline ;struct udl_device {struct drm_device drm;struct device *dev;
@@ -74,6 +76,7 @@ struct udl_device {int sku_pixel_limit;struct urb_list urbs; +struct udl_cursor cursor; };#define to_udl (x) container_of(x, struct udl_device, drm)
@@ -97,7 +100,8 @@ int udl_init(struct udl_device *udl);int udl_render_hline (struct drm_device *dev,int log_bpp,struct urb **urb_ptr,const char *front,char **urb_buf_ptr, -u32 byte_offset,u32 device_byte_offset,u32 byte_width); +u32 byte_offset,u32 device_byte_offset,u32 byte_width, +struct udl_cursor_hline *cursor_hline);int udl_drop_usb (struct drm_device *dev);int udl_select_std_channel (struct udl_device *udl);
drivers/gpu/drm/udl/udl_modeset.c +8 -1
@@ -26,6 +26,9 @@#include "udl_drv.h" #include "udl_proto.h" +#include "udl_cursor.h" + +#define UDL_COLOR_DEPTH_16BPP 0/* * All DisplayLink bulk operations start with 0xaf (UDL_MSG_BULK), followed by
@@ -204,6 +207,7 @@ static int udl_handle_damage(struct drm_framebuffer *fb, const struct drm_rect *clip) {struct drm_device *dev = fb->dev; +struct udl_device *udl =to_udl (dev);void *vaddr = map->vaddr;/* TODO: Use mapping abstraction properly */ int i, ret;char *cmd;
@@ -225,9 +229,12 @@ static int udl_handle_damage(struct drm_framebuffer *fb,const int byte_offset = line_offset + (clip->x1 << log_bpp);const int dev_byte_offset = (fb->width * i + clip->x1) << log_bpp;const int byte_width =drm_rect_width (clip) << log_bpp; +struct udl_cursor_hline cursor_hline; + +udl_cursor_get_hline (&udl->cursor, clip->x1, i, &cursor_hline); ret =udl_render_hline (dev, log_bpp, &urb, (char *)vaddr, &cmd, byte_offset, dev_byte_offset, - byte_width); + byte_width, &cursor_hline);if (ret)return ret; }
drivers/gpu/drm/udl/udl_transfer.c +34 -2
@@ -11,6 +11,7 @@#include "udl_drv.h" #include "udl_proto.h" +#include "udl_cursor.h" #define MAX_CMD_PIXELS 255
@@ -43,6 +44,19 @@ static inline u16 get_pixel_val16(const uint8_t *pixel, int log_bpp)return pixel_val16; } +static inline u16 blend_alpha (const uint16_t pixel_val16,uint32_t blend_val32) +{ +uint32_t alpha = (blend_val32 >>16 ); +uint32_t alpha_inv =64 - alpha; + +return (((pixel_val16 &0x1f ) * alpha_inv + + (blend_val32 &0x1f ) * alpha) >>6 ) | + ((((pixel_val16 &0x7e0 ) * alpha_inv + + (blend_val32 &0x7e0 ) * alpha) >>6 ) &0x7e0 ) | + ((((pixel_val16 &0xf800 ) * alpha_inv + + (blend_val32 &0xf800 ) * alpha) >>6 ) &0xf800 ); +} +/* * Render a command stream for an encoded horizontal line segment of pixels. *
@@ -74,6 +88,7 @@ static void udl_compress_hline16(const u8 **pixel_start_ptr, const u8 *const pixel_end, uint32_t *device_address_ptr, + struct udl_cursor_hline *cursor_hline, uint8_t **command_buffer_ptr, const uint8_t *const cmd_buffer_end, int log_bpp) {
@@ -81,6 +96,9 @@ static void udl_compress_hline16(const u8 *pixel = *pixel_start_ptr;uint32_t dev_addr = *device_address_ptr;uint8_t *cmd = *command_buffer_ptr; +const uint32_t *cursor_buf = cursor_hline ? cursor_hline->buffer :NULL ; +int cursor_pos = cursor_buf ? cursor_hline->offset :0 ; +int cursor_width = cursor_buf ? cursor_hline->width :0 ;while ((pixel_end > pixel) && (cmd_buffer_end -MIN_RLX_CMD_BYTES > cmd)) {
@@ -107,6 +125,11 @@ static void udl_compress_hline16( (unsigned long)(cmd_buffer_end - 1 - cmd) / 2) << log_bpp); pixel_val16 =get_pixel_val16 (pixel, log_bpp); +if (cursor_buf && cursor_pos >=0 && + cursor_pos < cursor_width) { + pixel_val16 =blend_alpha (pixel_val16, + cursor_buf[cursor_pos]); + }while (pixel < cmd_pixel_end) {const u8 *const start = pixel;
@@ -116,12 +139,19 @@ static void udl_compress_hline16( cmd +=2 ; pixel += bpp; + cursor_pos++;while (pixel < cmd_pixel_end) { pixel_val16 =get_pixel_val16 (pixel, log_bpp); +if (cursor_buf && cursor_pos >=0 && + cursor_pos < cursor_width) { + pixel_val16 =blend_alpha (pixel_val16, + cursor_buf[cursor_pos]); + }if (pixel_val16 != repeating_pixel_val16)break ; pixel += bpp; + cursor_pos++; }if (unlikely (pixel > start + bpp)) {
@@ -160,6 +190,8 @@ static void udl_compress_hline16( *command_buffer_ptr = cmd; *pixel_start_ptr = pixel; *device_address_ptr = dev_addr; +if (cursor_buf) + cursor_hline->offset = cursor_pos;return ; }
@@ -173,7 +205,7 @@ static void udl_compress_hline16(int udl_render_hline (struct drm_device *dev,int log_bpp,struct urb **urb_ptr,const char *front,char **urb_buf_ptr,u32 byte_offset,u32 device_byte_offset, -u32 byte_width) +u32 byte_width,struct udl_cursor_hline *cursor_hline) {const u8 *line_start, *line_end, *next_pixel;u32 base16 =0 + (device_byte_offset >> log_bpp) *2 ;
@@ -194,7 +226,7 @@ int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,while (next_pixel < line_end) {udl_compress_hline16 (&next_pixel, - line_end, &base16, + line_end, &base16, cursor_hline, (u8 **) &cmd, (u8 *) cmd_end, log_bpp);if (cmd >= cmd_end) {
Signature · 1 line
2.34.1
PATCH 2/4 drm/udl: Add cursor drm_plane support
In reply to [email protected]From: Łukasz Spintzyk <[email protected]>
Atomic support for cursor plane was inspired by evdi drm driver that is maintained on github.com/displaylink/evdi. Also added ARGB8888 plane format as it is used by cursor plane.
--- drivers/gpu/drm/udl/udl_cursor.c | 32 +++++++- drivers/gpu/drm/udl/udl_cursor.h | 8 ++ drivers/gpu/drm/udl/udl_drv.h | 1 + drivers/gpu/drm/udl/udl_modeset.c | 129 +++++++++++++++++++++++++----- 4 files changed, 150 insertions(+), 20 deletions(-)
drivers/gpu/drm/udl/udl_cursor.c +31 -1
@@ -3,6 +3,7 @@* udl_cursor.c * * Copyright (c) 2015 The Chromium OS Authors +* Copyright (c) 2024 Synaptics Incorporated. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the
@@ -69,10 +70,39 @@ int udl_cursor_download(struct udl_cursor *cursor,return 0 ; } -int udl_cursor_move (struct udl_cursor *cursor,int x,int y) { cursor->x = x; cursor->y = y;return 0 ; } + +void udl_cursor_damage_clear (struct udl_cursor *cursor) +{ + cursor->damage.x1 =INT_MAX ; + cursor->damage.y1 =INT_MAX ; + cursor->damage.x2 =0 ; + cursor->damage.y2 =0 ; +} + +void udl_rect_merge (struct drm_rect *rect,struct drm_rect *rect2) +{ + rect->x1 =min (rect->x1, rect2->x1); + rect->y1 =min (rect->y1, rect2->y1); + rect->x2 =max (rect->x2, rect2->x2); + rect->y2 =max (rect->y2, rect2->y2); +} + +void udl_cursor_mark_damage_from_plane (struct udl_cursor *cursor,struct drm_plane_state *state) +{ +struct drm_rect rect; + + rect.x1 = (state->crtc_x <0 ) ?0 : state->crtc_x; + rect.y1 = (state->crtc_y <0 ) ?0 : state->crtc_y; + rect.x2 = state->crtc_x + state->crtc_w; + rect.y2 = state->crtc_y + state->crtc_h; + +udl_rect_merge (&cursor->damage, &rect); +} + +
drivers/gpu/drm/udl/udl_cursor.h +8 -0
@@ -3,6 +3,7 @@* udl_cursor.h * * Copyright (c) 2015 The Chromium OS Authors +* Copyright (c) 2024 Synaptics Incorporated. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the
@@ -27,12 +28,15 @@#define UDL_CURSOR_W 64#define UDL_CURSOR_H 64#define UDL_CURSOR_BUF (UDL_CURSOR_W * UDL_CURSOR_H) +struct udl_cursor {uint32_t buffer[UDL_CURSOR_BUF ]; +struct drm_rect damage;// damage on primary bool enabled;int x;int y; }; +struct udl_cursor_hline {uint32_t *buffer;int width;
@@ -43,5 +47,9 @@ extern void udl_cursor_get_hline(struct udl_cursor *cursor, int x, int y, struct udl_cursor_hline *hline);extern int udl_cursor_move (struct udl_cursor *cursor,int x,int y);extern int udl_cursor_download (struct udl_cursor *cursor,const struct iosys_map *map); +void udl_cursor_damage_clear (struct udl_cursor *cursor); +void udl_rect_merge (struct drm_rect *rect,struct drm_rect *rect2); +void udl_cursor_mark_damage_from_plane (struct udl_cursor *cursor, +struct drm_plane_state *state);#endif
drivers/gpu/drm/udl/udl_drv.h +1 -0
@@ -68,6 +68,7 @@ struct udl_device {struct device *dmadev;struct drm_plane primary_plane; +struct drm_plane cursor_plane;struct drm_crtc crtc;struct drm_encoder encoder;
drivers/gpu/drm/udl/udl_modeset.c +110 -19
213 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH 3/4 drm/udl: Allow smaller plane sizes to allow cursor plane
In reply to [email protected]From: Łukasz Spintzyk <[email protected]>
--- drivers/gpu/drm/udl/udl_modeset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/udl/udl_modeset.c +2 -2
@@ -659,8 +659,8 @@ int udl_modeset_init(struct drm_device *dev)if (ret)return ret; - dev->mode_config.min_width =640 ; - dev->mode_config.min_height =480 ; + dev->mode_config.min_width =UDL_CURSOR_W ; + dev->mode_config.min_height =UDL_CURSOR_H ; dev->mode_config.max_width =2048 ; dev->mode_config.max_height =2048 ; dev->mode_config.preferred_depth =16 ;
Signature · 1 line
2.34.1
PATCH 4/4 drm/udl: Shutdown all CRTCs on usb disconnect
In reply to [email protected]From: Łukasz Spintzyk <[email protected]>
This is fixing some kernel panics on device unplug, that started to be more visible after implementing cursor plane support.
--- drivers/gpu/drm/udl/udl_drv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/udl/udl_drv.c +3 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Red Hat +* Copyright (c) 2024 Synaptics Incorporated. All Rights Reserved. */ #include <linux/module.h>
@@ -14,6 +15,7 @@#include <drm/drm_ioctl.h> #include <drm/drm_probe_helper.h> #include <drm/drm_print.h> +#include <drm/drm_atomic_helper.h> #include "udl_drv.h"
@@ -129,6 +131,7 @@ static void udl_usb_disconnect(struct usb_interface *interface)drm_kms_helper_poll_fini (dev);udl_drop_usb (dev);drm_dev_unplug (dev); +drm_atomic_helper_shutdown (dev); }/*
Signature · 1 line
2.34.1
Thomas Zimmermann
maintainerHi
Am 24.06.24 um 09:10 schrieb [email protected]:
Quoted 2 lines
This brings cursor on DisplayLink USB2.0 device on ChromeOS compositor that requires either crtc'c
cursor_setcallback or cursordrm_plane. Patch was tested on ChromeOS and Ubuntu 22.04 with Gnome/Wayland
NAK on this patchset. UDL has no HW cursor support, so we won't implement this in the driver. Software blending should be done in userspace, where you have CPU SIMD available.
Best regards
Thomas
Quoted 2 lines
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Quoted 9 lines · Thomas Zimmermann
Hi
Am 24.06.24 um 09:10 schrieb [email protected]:
Quoted 2 lines
This brings cursor on DisplayLink USB2.0 device on ChromeOS compositor that requires either crtc'c
cursor_setcallback or cursordrm_plane. Patch was tested on ChromeOS and Ubuntu 22.04 with Gnome/WaylandNAK on this patchset. UDL has no HW cursor support, so we won't implement this in the driver. Software blending should be done in userspace, where you have CPU SIMD available.
I think for drivers which do cpu upload and are vblank driven there's maybe a case for kernel implemented cursors due to latency reduction if the blending happens as late as possible. But udl just goes right ahead and uploads, so this doesn't help I think. damage tracking should, but we already have that.
So concurring here.
-Sima
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 14 lines · Daniel Vetter
CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe.
Quoted 9 lines · Thomas Zimmermann
Hi
Am 24.06.24 um 09:10 schrieb [email protected]:
Quoted 2 lines
This brings cursor on DisplayLink USB2.0 device on ChromeOS compositor that requires either crtc'c
cursor_setcallback or cursordrm_plane. Patch was tested on ChromeOS and Ubuntu 22.04 with Gnome/WaylandNAK on this patchset. UDL has no HW cursor support, so we won't implement this in the driver. Software blending should be done in userspace, where you have CPU SIMD available.
Quoted 5 lines
I think for drivers which do cpu upload and are vblank driven there's maybe a case for kernel implemented cursors due to latency reduction if the blending happens as late as possible. But udl just goes right ahead and uploads, so this doesn't help I think. damage tracking should, but we already have that.
Sorry, I don't get what you mean here. This implementation uploads only damaged primary plane area (gathered in udl_cursor_plane_helper_atomic_update) and uploads it to device in following immediately udl_primary_plane_helper_atomic_update. No full primary plane update is done in this case (which is done only when plane_state->fb != old_plane_state->fb, please check updated udl_primary_plane_helper_atomic_update)
Sorry i don't have hard numbers for that but this in overall should improve cursor latency (especially for move events) in which case whole primary plane render is saved and cursor update can be done without waiting for next vsync of the primary plane.
Ihmo this implementation can be useful to test and implement atomic updates for cursor plane in compositors.
Anyway thanks for your(Daniel and Thomas) responses, if there is something I can do to push it then let me know.
regards
Łukasz Spintzyk
Quoted 7 lines
So concurring here.
-Sima
--
Daniel Vetter
Software Engineer, Intel Corporation
https://urldefense.proofpoint.com/v2/url?u=http-3A__blog.ffwll.ch&d=DwIBAg&c=7dfBJ8cXbWjhc0BhImu8wVIoUFmBzj1s88r8EGyM0UY&r=0p1mI1lUPD-etxZm5xwnMe2dJnw8yCkW8EVTCGmBDPo&m=M1yfa7XuJVH9rCMPSuFfUD51RJsC3N6CNXSv9yDKmfmSUijg5Z3ngLzUqKBnbTgJ&s=Cs7RKpEwGAz4cdSnl3jqFctOKhaOpoHPGw3tSRPW2OI&e=
Quoted 7 lines · Lukasz Spintzyk
Quoted 6 lines · Daniel Vetter
CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe.
Quoted 2 lines · Thomas Zimmermann
Hi
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Am 24.06.24 um 09:10 schrieb [email protected]:
Quoted 2 lines
This brings cursor on DisplayLink USB2.0 device on ChromeOS compositor that requires either crtc'c
cursor_setcallback or cursordrm_plane. Patch was tested on ChromeOS and Ubuntu 22.04 with Gnome/WaylandNAK on this patchset. UDL has no HW cursor support, so we won't implement this in the driver. Software blending should be done in userspace, where you have CPU SIMD available.
Thank you Thomas,
Please check, my answer below Daniel's response.
I think that compositor still benefits cursor blending in the driver.
At least for ChromeOS in which udl based devices are only one without cursor plane support. I believe it can simplify compositor code in this case.
Another topic,
What do you think about "[PATCH 4/4] drm/udl: Shutdown all CRTCs on usb disconnect", IMO it is unrelated and happened to appear more frequently with cursor plane.
Shall I re-upload it as separate patchset?
regards
Łukasz Spintzyk
Quoted 25 lines
Quoted 6 lines
I think for drivers which do cpu upload and are vblank driven there's maybe a case for kernel implemented cursors due to latency reduction if the blending happens as late as possible. But udl just goes right ahead and uploads, so this doesn't help I think. damage tracking should, but we already have that.
Sorry, I don't get what you mean here. This implementation uploads only damaged primary plane area (gathered in
udl_cursor_plane_helper_atomic_update) and uploads it to device in following immediatelyudl_primary_plane_helper_atomic_update. No full primary plane update is done in this case (which is done only whenplane_state->fb!=old_plane_state->fb, please check updatedudl_primary_plane_helper_atomic_update)Sorry i don't have hard numbers for that but this in overall should improve cursor latency (especially for move events) in which case whole primary plane render is saved and cursor update can be done without waiting for next vsync of the primary plane.
Ihmo this implementation can be useful to test and implement atomic updates for cursor plane in compositors.
Anyway thanks for your(Daniel and Thomas) responses, if there is something I can do to push it then let me know.
regards
Łukasz SpintzykQuoted 7 lines
So concurring here.
-SimaSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation https://urldefense.proofpoint.com/v2/url?u=http-3A__blog.ffwll.ch&d=DwIBAg&c=7dfBJ8cXbWjhc0BhImu8wVIoUFmBzj1s88r8EGyM0UY&r=0p1mI1lUPD-etxZm5xwnMe2dJnw8yCkW8EVTCGmBDPo&m=M1yfa7XuJVH9rCMPSuFfUD51RJsC3N6CNXSv9yDKmfmSUijg5Z3ngLzUqKBnbTgJ&s=Cs7RKpEwGAz4cdSnl3jqFctOKhaOpoHPGw3tSRPW2OI&e=
Thomas Zimmermann
maintainerHi
Am 02.07.24 um 14:07 schrieb Lukasz Spintzyk:
Quoted 16 lines · Lukasz Spintzyk
Quoted 7 lines · Daniel Vetter
Quoted 6 lines
CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe.
Quoted 2 lines · Thomas Zimmermann
Hi
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Am 24.06.24 um 09:10 schrieb [email protected]:
Quoted 2 lines
This brings cursor on DisplayLink USB2.0 device on ChromeOS compositor that requires either crtc'c
cursor_setcallback or cursordrm_plane. Patch was tested on ChromeOS and Ubuntu 22.04 with Gnome/WaylandNAK on this patchset. UDL has no HW cursor support, so we won't implement this in the driver. Software blending should be done in userspace, where you have CPU SIMD available.
Quoted 5 lines
Thank you Thomas,
Please check, my answer below Daniel's response.
I think that compositor still benefits cursor blending in the driver.
At least for ChromeOS in which udl based devices are only one without cursor plane support. I believe it can simplify compositor code in this case.
But it complicates kernel code, which is a bad tradeoff.
Wrt the damage handling discussion in the other email, there's damage-handling support in the udl driver. It will only upload the small region around the cursor if the userspace tells it to. IIRC userspace needs to invoke the DIRTYFB [1] ioctl after updating the framebuffer data.
[1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_ioctl.c#L634
Quoted 3 lines
Another topic,
What do you think about "[PATCH 4/4] drm/udl: Shutdown all CRTCs on usb disconnect", IMO it is unrelated and happened to appear more frequently with cursor plane.
The patch's description mentions kernel panics. AFAICT the cursor-plane patches don't use drm_dev_enter() and _exit(). That would explain the panics. Do they also happen without the cursor-plane code?
Best regards
Thomas
Quoted 33 lines
Shall I re-upload it as separate patchset?
regards
Łukasz SpintzykQuoted 26 lines
Quoted 6 lines
I think for drivers which do cpu upload and are vblank driven there's maybe a case for kernel implemented cursors due to latency reduction if the blending happens as late as possible. But udl just goes right ahead and uploads, so this doesn't help I think. damage tracking should, but we already have that.
Sorry, I don't get what you mean here. This implementation uploads only damaged primary plane area (gathered in
udl_cursor_plane_helper_atomic_update) and uploads it to device in following immediatelyudl_primary_plane_helper_atomic_update. No full primary plane update is done in this case (which is done only whenplane_state->fb!=old_plane_state->fb, please check updatedudl_primary_plane_helper_atomic_update)Sorry i don't have hard numbers for that but this in overall should improve cursor latency (especially for move events) in which case whole primary plane render is saved and cursor update can be done without waiting for next vsync of the primary plane.
Ihmo this implementation can be useful to test and implement atomic updates for cursor plane in compositors.
Anyway thanks for your(Daniel and Thomas) responses, if there is something I can do to push it then let me know.
regards
Łukasz SpintzykQuoted 8 lines
So concurring here.
-SimaSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation https://urldefense.proofpoint.com/v2/url?u=http-3A__blog.ffwll.ch&d=DwIBAg&c=7dfBJ8cXbWjhc0BhImu8wVIoUFmBzj1s88r8EGyM0UY&r=0p1mI1lUPD-etxZm5xwnMe2dJnw8yCkW8EVTCGmBDPo&m=M1yfa7XuJVH9rCMPSuFfUD51RJsC3N6CNXSv9yDKmfmSUijg5Z3ngLzUqKBnbTgJ&s=Cs7RKpEwGAz4cdSnl3jqFctOKhaOpoHPGw3tSRPW2OI&e=
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)