Re: [PATCH 3/5] drm/fb-helper: Calculate damaged area in separate helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 09.02.22 um 12:02 schrieb Javier Martinez Canillas:
On 2/6/22 20:29, Thomas Zimmermann wrote:
Add drm_fb_helper_clip_to_memory_range(), a helper function that
accepts an linear range of video memory and converts it into a
rectangle. The computed rectangle describes the damaged area in
terms of scanlines and pixels per scanline.

While at it, make the code more readable by using struct drm_rect
and related helpers.

The code was previously part of the deferred I/O helpers, but is
also useful for damage handling of regular write operations. Update
the deferred I/O code to use the new function.

Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
---
  drivers/gpu/drm/drm_fb_helper.c | 26 ++++++++++++++++++++------
  1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 87c47093c3a2..ae98990c7b66 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -680,6 +680,19 @@ static void drm_fb_helper_damage(struct fb_info *info, u32 x, u32 y,
  	schedule_work(&helper->damage_work);
  }
+/* Convert memory region into area of scanlines and pixels per scanline */
+static void drm_fb_helper_clip_to_memory_range(struct fb_info *info, off_t off, size_t len,
+					       struct drm_rect *clip)
+{

Shouldn't be called drm_fb_helper_clip_from_memory_range() or
drm_fb_helper_memory_range_to_clip() instead ?

I thought that it means to make a clip rectangle from the memory range. But I think your name is better and more consistent with the rest of the code. I'll use it instead.

Best regards
Thomas


Otherwise it looks good to me.

Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>

Best regards,

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux