[RFC PATCH 4/4] etnaviv: Add PPU flop reset

Lucas Stach l.stach at pengutronix.de
Mon Jun 16 08:11:14 UTC 2025


Hi Gert,

Am Donnerstag, dem 05.06.2025 um 14:12 +0200 schrieb Gert Wollny:
> The PPU flop reset is required on some hardware to clear the
> temporary registers. This implementation follows the code
> implemented in the public galcore kernel module code to this
> for the PPU.
> 
> Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
> ---
> 
[...]
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_flop_reset.h b/drivers/gpu/drm/etnaviv/etnaviv_flop_reset.h
> new file mode 100644
> index 000000000000..c5c8f77f2176
> --- /dev/null
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_flop_reset.h
> @@ -0,0 +1,13 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2025 Etnaviv Project
> + */
> +
> +
> +#ifndef etnaviv_flop_reset_h
> +#define etnaviv_flop_reset_h
> +
> +void
> +etnaviv_flop_reset_ppu(struct etnaviv_gpu *gpu);
> +
> +#endif
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
> index 5cb46c84e03a..604a47f965b1 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
> @@ -122,6 +122,8 @@ struct etnaviv_gpu {
>  	struct etnaviv_cmdbuf buffer;
>  	int exec_state;
>  
> +	struct etnaviv_cmdbuf ppu_flopreset_data;
> +
You should be able to place this in etnaviv_drm_private, so if we have
multiple GPUs requiring the flop reset in a single driver instance, we
only pay the memory cost once. But then you should allocate this buffer
in etnaviv_gpu_bind to avoid races between GPUs starting up and trying
to allocate this global memory.

Regards,
Lucas

>  	/* event management: */
>  	DECLARE_BITMAP(event_bitmap, ETNA_NR_EVENTS);
>  	struct etnaviv_event event[ETNA_NR_EVENTS];



More information about the etnaviv mailing list