[Freedreno] [RFC PATCH] drm/msm: tune the devfreq to take into account the load history

2023-02-20 Thread Dmitry Baryshkov
Partially restore the handling of the GPU load history. Accumulate the busy_time and and total_time measured in active state during the polling period. This results in slightly smoother picture of the GPU frequencies (measured on the a530/msm8996, using kmscube in different resolutions). A call to

[Freedreno] [PATCH v5 14/14] drm/i915: Add deadline based boost support

2023-02-20 Thread Rob Clark
From: Rob Clark v2: rebase Signed-off-by: Rob Clark --- drivers/gpu/drm/i915/i915_request.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 7503dcb9043b..44491e7e214c 100644 --- a/drivers

[Freedreno] [PATCH v5 13/14] drm/msm: Add wait-boost support

2023-02-20 Thread Rob Clark
From: Rob Clark Add a way for various userspace waits to signal urgency. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_drv.c | 12 drivers/gpu/drm/msm/msm_gem.c | 5 + include/uapi/drm/msm_drm.h| 14 -- 3 files changed, 25 insertions(+), 6 deletions(-)

[Freedreno] [PATCH v5 09/14] drm/syncobj: Add deadline support for syncobj waits

2023-02-20 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 addjust GPU frequency accordingly. An immediate deadline can be

[Freedreno] [PATCH v5 12/14] drm/msm: Add deadline based boost support

2023-02-20 Thread Rob Clark
From: Rob Clark Track the nearest deadline on a fence timeline and set a timer to expire shortly before to trigger boost if the fence has not yet been signaled. v2: rebase Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_fence.c | 74 + drivers/gpu/drm/msm/

[Freedreno] [PATCH v5 07/14] dma-buf/sw_sync: Add fence deadline support

2023-02-20 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 fe

[Freedreno] [PATCH v5 10/14] drm/vblank: Add helper to get next vblank time

2023-02-20 Thread Rob Clark
From: Rob Clark Will be used in the next commit to set a deadline on fences that an atomic update is waiting on. Signed-off-by: Rob Clark --- drivers/gpu/drm/drm_vblank.c | 32 include/drm/drm_vblank.h | 1 + 2 files changed, 33 insertions(+) diff --git a

[Freedreno] [PATCH v5 11/14] drm/atomic-helper: Set fence deadline for vblank

2023-02-20 Thread Rob Clark
From: Rob Clark For an atomic commit updating a single CRTC (ie. a pageflip) calculate the next vblank time, and inform the fence(s) of that deadline. v2: Comment typo fix (danvet) Signed-off-by: Rob Clark Reviewed-by: Daniel Vetter Signed-off-by: Rob Clark --- drivers/gpu/drm/drm_atomic_he

[Freedreno] [PATCH v5 05/14] dma-buf/sync_file: Add SET_DEADLINE ioctl

2023-02-20 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: https://gitlab.freedesktop.org/robclark/igt-gpu-tools/-/commits/fence-deadline

[Freedreno] [PATCH v5 08/14] drm/scheduler: Add fence deadline support

2023-02-20 Thread Rob Clark
As the finished fence is the one that is exposed to userspace, and therefore the one that other operations, like atomic update, would block on, we need to propagate the deadline from from the finished fence to the actual hw fence. v2: Split into drm_sched_fence_set_parent() (ckoenig) v3: Ensure a

[Freedreno] [PATCH v5 03/14] dma-buf/fence-chain: Add fence deadline support

2023-02-20 Thread Rob Clark
From: Rob Clark Propagate the deadline to all the fences in the chain. Signed-off-by: Rob Clark Reviewed-by: Christian König for this one. --- drivers/dma-buf/dma-fence-chain.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-

[Freedreno] [PATCH v5 02/14] dma-buf/fence-array: Add fence deadline support

2023-02-20 Thread Rob Clark
From: Rob Clark Propagate the deadline to all the fences in the array. Signed-off-by: Rob Clark Reviewed-by: Christian König --- drivers/dma-buf/dma-fence-array.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-ar

[Freedreno] [PATCH v5 06/14] dma-buf/sync_file: Support (E)POLLPRI

2023-02-20 Thread Rob Clark
From: Rob Clark Allow userspace to use the EPOLLPRI/POLLPRI flag to indicate an urgent wait (as opposed to a "housekeeping" wait to know when to cleanup after some work has completed). Usermode components of GPU driver stacks often poll() on fence fd's to know when it is safe to do things like f

[Freedreno] [PATCH v5 01/14] dma-buf/dma-fence: Add deadline awareness

2023-02-20 Thread Rob Clark
From: Rob Clark Add a way to hint to the fence signaler of an upcoming deadline, such as vblank, which the fence waiter would prefer not to miss. This is to aid the fence signaler in making power management decisions, like boosting frequency as the deadline approaches and awareness of missing de

[Freedreno] [PATCH v5 04/14] dma-buf/dma-resv: Add a way to set fence deadline

2023-02-20 Thread Rob Clark
From: Rob Clark Add a way to set a deadline on remaining resv fences according to the requested usage. Signed-off-by: Rob Clark Reviewed-by: Christian König --- drivers/dma-buf/dma-resv.c | 22 ++ include/linux/dma-resv.h | 2 ++ 2 files changed, 24 insertions(+) diff

[Freedreno] [PATCH v5 00/14] dma-fence: Deadline awareness

2023-02-20 Thread Rob Clark
From: Rob Clark This series adds a deadline hint to fences, so realtime deadlines such as vblank can be communicated to the fence signaller for power/ frequency management decisions. This is partially inspired by a trick i915 does, but implemented via dma-fence for a couple of reasons: 1) To co

Re: [Freedreno] [PATCH v2] drm/msm: DEVFREQ_GOV_SIMPLE_ONDEMAND is no longer needed

2023-02-20 Thread Rob Clark
On Sun, Feb 19, 2023 at 5:04 PM Randy Dunlap wrote: > > DRM_MSM no longer needs DEVFREQ_GOV_SIMPLE_ONDEMAND (since dbd7a2a941b8 > in linux-next: PM / devfreq: Fix build issues with devfreq disabled), > so remove that select from the DRM_MSM Kconfig file. > > Fixes: 6563f60f14cb ("drm/msm/gpu: Add

Re: [Freedreno] [PATCH v4 09/14] drm/syncobj: Add deadline support for syncobj waits

2023-02-20 Thread Rob Clark
On Mon, Feb 20, 2023 at 1:05 AM Pekka Paalanen wrote: > > On Sat, 18 Feb 2023 13:15:52 -0800 > Rob Clark wrote: > > > 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 > > backin

Re: [Freedreno] [PATCH v4 06/14] dma-buf/sync_file: Support (E)POLLPRI

2023-02-20 Thread Rob Clark
On Mon, Feb 20, 2023 at 12:53 AM Pekka Paalanen wrote: > > On Sat, 18 Feb 2023 13:15:49 -0800 > Rob Clark wrote: > > > From: Rob Clark > > > > Allow userspace to use the EPOLLPRI/POLLPRI flag to indicate an urgent > > wait (as opposed to a "housekeeping" wait to know when to cleanup after > > so

Re: [Freedreno] [PATCH v4 05/14] dma-buf/sync_file: Add SET_DEADLINE ioctl

2023-02-20 Thread Rob Clark
On Mon, Feb 20, 2023 at 12:27 AM Christian König wrote: > > Am 18.02.23 um 22:15 schrieb 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

Re: [Freedreno] [PATCH v4 10/14] drm/vblank: Add helper to get next vblank time

2023-02-20 Thread Rob Clark
On Mon, Feb 20, 2023 at 1:08 AM Pekka Paalanen wrote: > > On Sat, 18 Feb 2023 13:15:53 -0800 > Rob Clark wrote: > > > From: Rob Clark > > > > Will be used in the next commit to set a deadline on fences that an > > atomic update is waiting on. > > > > Signed-off-by: Rob Clark > > --- > > driver

Re: [Freedreno] [PATCH v4 14/14] drm/i915: Add deadline based boost support

2023-02-20 Thread Tvrtko Ursulin
On 18/02/2023 21:15, Rob Clark wrote: From: Rob Clark Signed-off-by: Rob Clark --- This should probably be re-written by someone who knows the i915 request/timeline stuff better, to deal with non-immediate deadlines. But as-is I think this should be enough to handle the case where we want s

Re: [Freedreno] [PATCH v2 06/14] drm/msm/gpu: Use dev_pm_opp_set_rate for non-GMU GPUs

2023-02-20 Thread Dmitry Baryshkov
On Mon, 20 Feb 2023 at 11:59, Konrad Dybcio wrote: > On 18.02.2023 17:47, Dmitry Baryshkov wrote: > > On 18/02/2023 13:04, Konrad Dybcio wrote: > >> On 17.02.2023 22:07, Dmitry Baryshkov wrote: > >>> On 14/02/2023 19:31, Konrad Dybcio wrote: > Currently we only utilize the OPP table connected

Re: [Freedreno] [PATCH v2 1/2] dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible

2023-02-20 Thread Konrad Dybcio
On 20.02.2023 11:31, Krzysztof Kozlowski wrote: > On 20/02/2023 11:24, Konrad Dybcio wrote: >> >> >> On 18.02.2023 15:49, Krzysztof Kozlowski wrote: >>> On 18/02/2023 12:23, Konrad Dybcio wrote: On 18.02.2023 11:14, Krzysztof Kozlowski wrote: > On 17/02/2023 22:13, Bryan O'Don

Re: [Freedreno] [PATCH v2 1/2] dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible

2023-02-20 Thread Krzysztof Kozlowski
On 20/02/2023 11:24, Konrad Dybcio wrote: > > > On 18.02.2023 15:49, Krzysztof Kozlowski wrote: >> On 18/02/2023 12:23, Konrad Dybcio wrote: >>> >>> >>> On 18.02.2023 11:14, Krzysztof Kozlowski wrote: On 17/02/2023 22:13, Bryan O'Donoghue wrote: > On 17/02/2023 12:24, Krzysztof Kozlowski

Re: [Freedreno] [PATCH v2 1/2] dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible

2023-02-20 Thread Konrad Dybcio
On 18.02.2023 15:49, Krzysztof Kozlowski wrote: > On 18/02/2023 12:23, Konrad Dybcio wrote: >> >> >> On 18.02.2023 11:14, Krzysztof Kozlowski wrote: >>> On 17/02/2023 22:13, Bryan O'Donoghue wrote: On 17/02/2023 12:24, Krzysztof Kozlowski wrote: > First, it would be nice to know what wa

Re: [Freedreno] [PATCH v2 06/14] drm/msm/gpu: Use dev_pm_opp_set_rate for non-GMU GPUs

2023-02-20 Thread Konrad Dybcio
On 20.02.2023 10:59, Konrad Dybcio wrote: > > > On 18.02.2023 17:47, Dmitry Baryshkov wrote: >> On 18/02/2023 13:04, Konrad Dybcio wrote: >>> >>> >>> On 17.02.2023 22:07, Dmitry Baryshkov wrote: On 14/02/2023 19:31, Konrad Dybcio wrote: > Currently we only utilize the OPP table connec

Re: [Freedreno] [PATCH v2 06/14] drm/msm/gpu: Use dev_pm_opp_set_rate for non-GMU GPUs

2023-02-20 Thread Konrad Dybcio
On 18.02.2023 17:47, Dmitry Baryshkov wrote: > On 18/02/2023 13:04, Konrad Dybcio wrote: >> >> >> On 17.02.2023 22:07, Dmitry Baryshkov wrote: >>> On 14/02/2023 19:31, Konrad Dybcio wrote: Currently we only utilize the OPP table connected to the GPU for getting (available) frequencies.

Re: [Freedreno] [PATCH v4 10/14] drm/vblank: Add helper to get next vblank time

2023-02-20 Thread Pekka Paalanen
On Sat, 18 Feb 2023 13:15:53 -0800 Rob Clark wrote: > From: Rob Clark > > Will be used in the next commit to set a deadline on fences that an > atomic update is waiting on. > > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/drm_vblank.c | 32 > include/drm/

Re: [Freedreno] [PATCH v4 09/14] drm/syncobj: Add deadline support for syncobj waits

2023-02-20 Thread Pekka Paalanen
On Sat, 18 Feb 2023 13:15:52 -0800 Rob Clark wrote: > 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

Re: [Freedreno] [PATCH v4 06/14] dma-buf/sync_file: Support (E)POLLPRI

2023-02-20 Thread Pekka Paalanen
On Sat, 18 Feb 2023 13:15:49 -0800 Rob Clark wrote: > From: Rob Clark > > Allow userspace to use the EPOLLPRI/POLLPRI flag to indicate an urgent > wait (as opposed to a "housekeeping" wait to know when to cleanup after > some work has completed). Usermode components of GPU driver stacks > ofte

Re: [Freedreno] [PATCH v4 05/14] dma-buf/sync_file: Add SET_DEADLINE ioctl

2023-02-20 Thread Pekka Paalanen
On Sat, 18 Feb 2023 13:15:48 -0800 Rob Clark wrote: > 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: > > https:

Re: [Freedreno] [PATCH v4 06/14] dma-buf/sync_file: Support (E)POLLPRI

2023-02-20 Thread Christian König
Am 18.02.23 um 22:15 schrieb Rob Clark: From: Rob Clark Allow userspace to use the EPOLLPRI/POLLPRI flag to indicate an urgent wait (as opposed to a "housekeeping" wait to know when to cleanup after some work has completed). Usermode components of GPU driver stacks often poll() on fence fd's t

Re: [Freedreno] [PATCH v4 07/14] dma-buf/sw_sync: Add fence deadline support

2023-02-20 Thread Christian König
Am 18.02.23 um 22:15 schrieb 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

Re: [Freedreno] [PATCH v4 05/14] dma-buf/sync_file: Add SET_DEADLINE ioctl

2023-02-20 Thread Christian König
Am 18.02.23 um 22:15 schrieb 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: https://gitlab.freedesktop.org/robcl

Re: [Freedreno] [PATCH v4 04/14] dma-buf/dma-resv: Add a way to set fence deadline

2023-02-20 Thread Christian König
Am 18.02.23 um 22:15 schrieb Rob Clark: From: Rob Clark Add a way to set a deadline on remaining resv fences according to the requested usage. Signed-off-by: Rob Clark --- drivers/dma-buf/dma-resv.c | 19 +++ include/linux/dma-resv.h | 2 ++ 2 files changed, 21 insertio