]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/etnaviv: Add PPU flop reset
authorGert Wollny <gert.wollny@collabora.com>
Wed, 19 Nov 2025 16:45:50 +0000 (17:45 +0100)
committerChristian Gmeiner <cgmeiner@igalia.com>
Tue, 6 Jan 2026 15:43:19 +0000 (16:43 +0100)
commit85ba57ad88cf96b2fb4cf6c81639c7907bf3cd94
treea687ebc2f94d9691526645bc9657e3cf543d4bbf
parent9fcdece1a734bc71d2d9f9e3dd301cc9fff23327
drm/etnaviv: Add PPU flop reset

The PPU flop reset is required on some hardware to clear the
temporary registers. This code follows the implementation
of the PPU flop reset as found in the public galcore kernel
module. Compared to that code some superfluous parts were
removed and only the code path for SoC chip_model = 0x8000
and revision = 0x6205 is implemented and tested.

v2: - Move flop reset data to etnaviv_drm_private and initialize it
      from etnaviv_gpu_bind (Lucas)
    - Prepare code for more chip IDs and other flop reset types
    - Do some cleanups and rename some functions

v3: - Move initialization of flop reset data to etnaviv_gpu_init (Lucas)
    - Free PPU data suballocation (Lucas)

v4: As suggested by
    - replace "asm-generic/int-ll64.h" with "linux/types.h"
    - drop flop reset type enum since we only support one type here
    - move function return parameters on same line with function name
    - replace open coded for loop with memset32
    - add cnost to local static values
    - add a return value to etnaviv_flop_reset_ppu_init; handle and
      pass errors on to the caller
    - handle etnaviv_flop_reset_ppu_init return value
    - use dev_err for flop reset error message
    - fix include guard to be consistent with the other driver code
    - fix license header and formatting

v5: As suggested by Christian Gmeiner:
    - add required header that is no longer pulled in by etnaviv_buffer.h
    - fix include style of linux headers
    - free flop_reset_data_ppu when command buffer initialization fails
    - fix typo in error message

[cgmeiner: fix SPDX comment style, fix line end with a '(' and fix typo]

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Tested-by: Marek Vasut <marek.vasut@mailbox.org> # STM32MP255C DHCOS DHSBC
Link: https://patch.msgid.link/20251119164624.9297-5-gert.wollny@collabora.com
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
drivers/gpu/drm/etnaviv/Makefile
drivers/gpu/drm/etnaviv/etnaviv_buffer.c
drivers/gpu/drm/etnaviv/etnaviv_buffer.h
drivers/gpu/drm/etnaviv/etnaviv_drv.c
drivers/gpu/drm/etnaviv/etnaviv_drv.h
drivers/gpu/drm/etnaviv/etnaviv_flop_reset.c [new file with mode: 0644]
drivers/gpu/drm/etnaviv/etnaviv_flop_reset.h [new file with mode: 0644]
drivers/gpu/drm/etnaviv/etnaviv_gpu.c