Re: [PATCH v2 1/3] drm/panic: only draw the foreground color in drm_panic_blit()

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

 



Jocelyn Falempe <jfalempe@xxxxxxxxxx> writes:

Hello Jocelyn,

> The whole framebuffer is cleared, so it's useless to rewrite the
> background colored pixels. It allows to simplify the drawing
> functions, and prepare the work for the set_pixel() callback.
>
> v2:
>  * keep fg16/fg24/fg32 as variable name for the blit function.
>  * add drm_panic_is_pixel_fg() to avoid code duplication.
>  both suggested by Javier Martinez Canillas
>
> Signed-off-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_panic.c | 67 +++++++++++++++++--------------------
>  1 file changed, 31 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
> index 7ece67086cec..056494ae1ede 100644
> --- a/drivers/gpu/drm/drm_panic.c
> +++ b/drivers/gpu/drm/drm_panic.c
> @@ -194,40 +194,42 @@ static u32 convert_from_xrgb8888(u32 color, u32 format)
>  /*
>   * Blit & Fill
>   */
> +/* check if the pixel at coord x,y is 1 (foreground) or 0 (background) */
> +static bool drm_panic_is_pixel_fg(const u8 *sbuf8, unsigned int spitch, int x, int y)
> +{
> +	return (sbuf8[(y * spitch) + x / 8] & (0x80 >> (x % 8))) != 0;
> +}

Thanks for doing this! The code is much easier to follow now IMO.

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

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat




[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