[PATCH i-g-t 04/14] lib/igt_draw: Support 8bpp int the mmap/pwrite paths

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Oct 22 15:54:37 UTC 2024


Hi Ville,
On 2024-10-04 at 13:41:11 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Handle 8bpp pixels formats correcly in the mmap/pwrite
> methods.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  lib/igt_draw.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_draw.c b/lib/igt_draw.c
> index 54c46fe6360c..b39a33dcf2cb 100644
> --- a/lib/igt_draw.c
> +++ b/lib/igt_draw.c
> @@ -365,7 +365,10 @@ static void tile4_pos_to_x_y_linear(int tiled_pos, uint32_t stride,
>  
>  static void set_pixel(void *_ptr, int index, uint64_t color, int bpp)
>  {
> -	if (bpp == 16) {
> +	if (bpp == 8) {
> +		uint8_t *ptr = _ptr;
> +		ptr[index] = color;
> +	} else if (bpp == 16) {
>  		uint16_t *ptr = _ptr;
>  		ptr[index] = color;
>  	} else if (bpp == 32) {
> -- 
> 2.45.2
> 


More information about the igt-dev mailing list