[Freedreno] [PATCH v2 5/6] drm/panfrost: Implement generic DRM object RSS reporting function

2023-08-23 Thread Adrián Larumbe
BO's RSS is updated every time new pages are allocated and mapped for the object, either in its entirety at creation time for non-heap buffers, or else on demand for heap buffers at GPU page fault's IRQ handler. Same calculations had to be done for imported PRIME objects, since backing storage

[Freedreno] [PATCH v2 6/6] drm/drm-file: Allow size unit selection in drm_show_memory_stats

2023-08-23 Thread Adrián Larumbe
The current implementation will try to pick the highest available unit. This is rather unflexible, and allowing drivers to display BO size statistics through fdinfo in units of their choice might be desirable. The new argument to drm_show_memory_stats is to be interpreted as the integer

[Freedreno] [PATCH v2 0/6] Add fdinfo support to Panfrost

2023-08-23 Thread Adrián Larumbe
This patch series adds fdinfo support to the Panfrost DRM driver. It will display a series of key:value pairs under /proc/pid/fdinfo/fd for render processes that open the Panfrost DRM file. The pairs contain basic drm gpu engine and memory region information that can either be cat by a privileged

[Freedreno] [PATCH v2 3/6] drm/panfrost: Add fdinfo support for memory stats

2023-08-23 Thread Adrián Larumbe
A new DRM GEM object function is added so that drm_show_memory_stats can provider more accurate memory usage numbers. Ideally, in panfrost_gem_status, the BO's purgeable flag would be checked after locking the driver's shrinker mutex, but drm_show_memory_stats takes over the drm file's object

[Freedreno] [PATCH v2 2/6] drm/panfrost: Add fdinfo support GPU load metrics

2023-08-23 Thread Adrián Larumbe
The drm-stats fdinfo tags made available to user space are drm-engine, drm-cycles, drm-max-freq and drm-curfreq, one per job slot. This deviates from standard practice in other DRM drivers, where a single set of key:value pairs is provided for the whole render engine. However, Panfrost has

[Freedreno] [PATCH v2 4/6] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-08-23 Thread Adrián Larumbe
Some BO's might be mapped onto physical memory chunkwise and on demand, like Panfrost's tiler heap. In this case, even though the drm_gem_shmem_object page array might already be allocated, only a very small fraction of the BO is currently backed by system memory, but drm_show_memory_stats will

[Freedreno] [PATCH v2 1/6] drm/panfrost: Add cycle count GPU register definitions

2023-08-23 Thread Adrián Larumbe
These GPU registers will be used when programming the cycle counter, which we need for providing accurate fdinfo drm-cycles values to user space. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_regs.h | 5 + 1 file changed, 5 insertions(+) diff --git

Re: [Freedreno] [PATCH v2 2/6] drm/panfrost: Add fdinfo support GPU load metrics

2023-08-23 Thread kernel test robot
Hi Adrián, kernel test robot noticed the following build warnings: [auto build test WARNING on drm-misc/drm-misc-next] [also build test WARNING on linus/master v6.5-rc7 next-20230823] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest

[Freedreno] [PATCH v9 3/3] dma-buf/sw_sync: Add fence deadline support

2023-08-23 Thread Rob Clark
From: Rob Clark This consists of simply storing the most recent deadline, and adding an ioctl to retrieve the deadline. This can be used in conjunction with the SET_DEADLINE ioctl on a fence fd for testing. Ie. create various sw_sync fences, merge them into a fence-array, set deadline on the

[Freedreno] [PATCH v9 2/3] dma-buf/sync_file: Add SET_DEADLINE ioctl

2023-08-23 Thread Rob Clark
From: Rob Clark The initial purpose is for igt tests, but this would also be useful for compositors that wait until close to vblank deadline to make decisions about which frame to show. The igt tests can be found at:

[Freedreno] [PATCH v9 1/3] drm/syncobj: Add deadline support for syncobj waits

2023-08-23 Thread Rob Clark
From: Rob Clark Add a new flag to let userspace provide a deadline as a hint for syncobj and timeline waits. This gives a hint to the driver signaling the backing fences about how soon userspace needs it to compete work, so it can adjust GPU frequency accordingly. An immediate deadline can be

[Freedreno] [PATCH v9 0/3] dma-fence: Deadline awareness (uabi edition)

2023-08-23 Thread Rob Clark
From: Rob Clark This is a re-post of the remaining patches from: https://patchwork.freedesktop.org/series/114490/ Part of the hold-up of the remaining uabi patches was compositor support, but now an MR for kwin exists: https://invent.kde.org/plasma/kwin/-/merge_requests/4358 The syncobj

Re: [Freedreno] [PATCH v5 03/11] PM / QoS: Fix constraints alloc vs reclaim locking

2023-08-23 Thread Rob Clark
On Tue, Aug 22, 2023 at 11:48 AM Rafael J. Wysocki wrote: > > On Tue, Aug 22, 2023 at 8:02 PM Rob Clark wrote: > > > > From: Rob Clark > > > > In the process of adding lockdep annotation for drm GPU scheduler's > > job_run() to detect potential deadlock against shrinker/reclaim, I hit > > this

[Freedreno] [PATCH v3 06/10] drm/msm/a6xx: Send ACD state to QMP at GMU resume

2023-08-23 Thread Konrad Dybcio
The QMP mailbox expects to be notified of the ACD (Adaptive Clock Distribution) state. Get a handle to the mailbox at probe time and poke it at GMU resume. Since we don't fully support ACD yet, hardcode the message to "val: 0" (state = disabled). Tested-by: Neil Armstrong # on SM8550-QRD

[Freedreno] [PATCH v3 09/10] drm/msm/a6xx: Add A740 support

2023-08-23 Thread Konrad Dybcio
A740 builds upon the A730 IP, shuffling some values and registers around. More differences will appear when things like BCL are implemented. adreno_is_a740_family is added in preparation for more A7xx GPUs, the logic checks will be valid resulting in smaller diffs. Tested-by: Neil Armstrong #

[Freedreno] [PATCH v3 07/10] drm/msm/a6xx: Mostly implement A7xx gpu_state

2023-08-23 Thread Konrad Dybcio
Provide the necessary alternations to mostly support state dumping on A7xx. Newer GPUs will probably require more changes here. Crashdumper and debugbus remain untested. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio ---

[Freedreno] [PATCH v3 10/10] drm/msm/a6xx: Poll for GBIF unhalt status in hw_init

2023-08-23 Thread Konrad Dybcio
Some GPUs - particularly A7xx ones - are really really stubborn and sometimes take a longer-than-expected time to finish unhalting GBIF. Note that this is not caused by the request a few lines above. Poll for the unhalt ack to make sure we're not trying to write bits to an essentially dead GPU

[Freedreno] [PATCH v3 05/10] drm/msm/a6xx: Add skeleton A7xx support

2023-08-23 Thread Konrad Dybcio
A7xx GPUs are - from kernel's POV anyway - basically another generation of A6xx. They build upon the A650/A660_family advancements, skipping some writes (presumably more values are preset correctly on reset), adding some new ones and changing others. One notable difference is the introduction of

[Freedreno] [PATCH v3 08/10] drm/msm/a6xx: Add A730 support

2023-08-23 Thread Konrad Dybcio
Add support for Adreno 730, also known as GEN7_0_x, found on SM8450. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 126 -

[Freedreno] [PATCH v3 03/10] dt-bindings: display/msm/gpu: Allow A7xx SKUs

2023-08-23 Thread Konrad Dybcio
Allow A7xx SKUs, such as the A730 GPU found on SM8450 and friends. They use GMU for all things DVFS, just like most A6xx GPUs. Reviewed-by: Krzysztof Kozlowski Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio ---

[Freedreno] [PATCH v3 04/10] drm/msm/a6xx: Add missing regs for A7XX

2023-08-23 Thread Konrad Dybcio
Add some missing definitions required for A7 support. This may be substituted with a mesa header sync. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx.xml.h | 9 +

[Freedreno] [PATCH v3 02/10] dt-bindings: display/msm/gmu: Allow passing QMP handle

2023-08-23 Thread Konrad Dybcio
When booting the GMU, the QMP mailbox should be pinged about some tunables (e.g. adaptive clock distribution state). To achieve that, a reference to it is necessary. Allow it and require it with A730. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Acked-by:

[Freedreno] [PATCH v3 00/10] A7xx support

2023-08-23 Thread Konrad Dybcio
This series attempts to introduce Adreno 700 support (with A730 and A740 found on SM8450 and SM8550 respectively), reusing much of the existing A6xx code. This submission largely lays the groundwork for expansion and more or less gives us feature parity (on the kernel side, that is) with existing

[Freedreno] [PATCH v3 01/10] dt-bindings: display/msm/gmu: Add Adreno 7[34]0 GMU

2023-08-23 Thread Konrad Dybcio
The GMU on the A7xx series is pretty much the same as on the A6xx parts. It's now "smarter", needs a bit less register writes and controls more things (like inter-frame power collapse) mostly internally (instead of us having to write to G[PM]U_[CG]X registers from APPS) The only difference worth