[PATCH 2/3] drm/panic: Add a set_pixel() callback to drm_scanout_buffer
Jocelyn Falempe
jfalempe at redhat.com
Fri May 31 09:32:37 UTC 2024
On 31/05/2024 11:20, Javier Martinez Canillas wrote:
> Jocelyn Falempe <jfalempe at redhat.com> writes:
>
>> This allows drivers to draw the pixel, and handle tiling, or specific
>> color formats.
>>
>> Signed-off-by: Jocelyn Falempe <jfalempe at redhat.com>
>> ---
>> drivers/gpu/drm/drm_panic.c | 120 +++++++++++++++++++++++-------------
>> include/drm/drm_panic.h | 9 +++
>> 2 files changed, 85 insertions(+), 44 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
>> index 9d95c7eaae83..27e26b9d842c 100644
>> --- a/drivers/gpu/drm/drm_panic.c
>> +++ b/drivers/gpu/drm/drm_panic.c
>> @@ -241,40 +241,54 @@ static void drm_panic_blit32(struct iosys_map *dmap, unsigned int dpitch,
>> iosys_map_wr(dmap, y * dpitch + x * sizeof(u32), u32, color);
>> }
>>
>> +static void drm_panic_blit_pixel(struct drm_scanout_buffer *sb, struct drm_rect *clip,
>> + const u8 *sbuf8, unsigned int spitch, u32 color)
>> +{
>> + unsigned int y, x;
>> +
>> + for (y = 0; y < drm_rect_height(clip); y++)
>> + for (x = 0; x < drm_rect_width(clip); x++)
>> + if (sbuf8[(y * spitch) + x / 8] & (0x80 >> (x % 8)))
>
> You have the same check for fb vs bg in all your blit helpers, so maybe
> this can be a macro or static inline function instead ? That would also
> help with the issue I mentioned about making the logic easier to read.
Sure, I can do a v2, or send an additional patch for that.
>
> Reviewed-by: Javier Martinez Canillas <javierm at redhat.com>
>
Thanks,
--
Jocelyn
More information about the dri-devel
mailing list