Re: [Freedreno] [PATCH 00/14] drm: Make DRM's IRQ helpers legacy

2021-07-27 Thread Thomas Zimmermann
Hi Sam Am 27.07.21 um 20:51 schrieb Sam Ravnborg: Hi Thomas, On Tue, Jul 27, 2021 at 08:27:07PM +0200, Thomas Zimmermann wrote: DRM's IRQ helpers are only helpful for old, non-KMS drivers. Move the code behind CONFIG_DRM_LEGACY. Convert KMS drivers to Linux IRQ interfaces. DRM provides IRQ

[Freedreno] [PATCH v4 13/13] drm/msm/gem: Mark active before pinning

2021-07-27 Thread Rob Clark
From: Rob Clark Mark all the bos in the submit as active, before pinning, to prevent evicting a buffer in the same submit to make room for a buffer earlier in the table. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c| 2 -- drivers/gpu/drm/msm/msm_gem_submit.c | 28

[Freedreno] [PATCH v4 12/13] drm/msm: Utilize gpu scheduler priorities

2021-07-27 Thread Rob Clark
From: Rob Clark The drm/scheduler provides additional prioritization on top of that provided by however many number of ringbuffers (each with their own priority level) is supported on a given generation. Expose the additional levels of priority to userspace and map the userspace priority back

[Freedreno] [PATCH v4 08/13] drm/msm: Return ERR_PTR() from submit_create()

2021-07-27 Thread Rob Clark
From: Rob Clark In the next patch, we start having more than a single potential failure reason. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem_submit.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git

[Freedreno] [PATCH v4 09/13] drm/msm: Conversion to drm scheduler

2021-07-27 Thread Rob Clark
From: Rob Clark For existing adrenos, there is one or more ringbuffer, depending on whether preemption is supported. When preemption is supported, each ringbuffer has it's own priority. A submitqueue (which maps to a gl context or vk queue in userspace) is mapped to a specific ring- buffer at

[Freedreno] [PATCH v4 11/13] drm/msm: Drop struct_mutex in submit path

2021-07-27 Thread Rob Clark
From: Rob Clark It is sufficient to serialize on the submit queue now. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem_submit.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c

[Freedreno] [PATCH v4 10/13] drm/msm: Drop submit bo_list

2021-07-27 Thread Rob Clark
From: Rob Clark This was only used to detect userspace including the same bo multiple times in a submit. But ww_mutex can already tell us this. When we drop struct_mutex around the submit ioctl, we'd otherwise need to lock the bo before adding it to the bo_list. But since ww_mutex can already

[Freedreno] [PATCH v4 07/13] drm/msm: Track "seqno" fences by idr

2021-07-27 Thread Rob Clark
From: Rob Clark Previously the (non-fd) fence returned from submit ioctl was a raw seqno, which is scoped to the ring. But from UABI standpoint, the ioctls related to seqno fences all specify a submitqueue. We can take advantage of that to replace the seqno fences with a cyclic idr handle.

[Freedreno] [PATCH v4 06/13] drm/msm: Consolidate submit bo state

2021-07-27 Thread Rob Clark
From: Rob Clark Move all the locked/active/pinned state handling to msm_gem_submit.c. In particular, for drm/scheduler, we'll need to do all this before pushing the submit job to the scheduler. But while we're at it we can get rid of the dupicate pin and refcnt. Signed-off-by: Rob Clark

[Freedreno] [PATCH v4 05/13] drm/msm/submit: Simplify out-fence-fd handling

2021-07-27 Thread Rob Clark
From: Rob Clark No need for this to be split in two parts. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem_submit.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c

[Freedreno] [PATCH v4 04/13] drm: Drop drm_gem_object_put_locked()

2021-07-27 Thread Rob Clark
From: Rob Clark Now that no one is using it, remove it. Signed-off-by: Rob Clark Acked-by: Christian König Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_gem.c | 22 -- include/drm/drm_gem.h | 2 -- 2 files changed, 24 deletions(-) diff --git

[Freedreno] [PATCH v4 03/13] drm/msm: drop drm_gem_object_put_locked()

2021-07-27 Thread Rob Clark
From: Rob Clark No idea why we were still using this. It certainly hasn't been needed for some time. So drop the pointless twin codepaths. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.c

[Freedreno] [PATCH v4 02/13] drm/msm: Small submitqueue creation cleanup

2021-07-27 Thread Rob Clark
From: Rob Clark If we don't have a gpu, there is no need to create a submitqueue, which lets us simplify the error handling and submitqueue creation. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_submitqueue.c | 22 +++--- 1 file changed, 11

[Freedreno] [PATCH v4 01/13] drm/msm: Docs and misc cleanup

2021-07-27 Thread Rob Clark
From: Rob Clark Fix a couple incorrect or misspelt comments, and add submitqueue doc comment. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem.h | 3 +-- drivers/gpu/drm/msm/msm_gem_submit.c | 1 + drivers/gpu/drm/msm/msm_gpu.h | 15

[Freedreno] [PATCH v4 00/13] drm/msm: drm scheduler conversion and cleanups

2021-07-27 Thread Rob Clark
From: Rob Clark Conversion to gpu_scheduler, and bonus removal of drm_gem_object_put_locked() v2: Fix priority mixup (msm UAPI has lower numeric priority value as higher priority, inverse of drm/scheduler) and add some comments in the UAPI header to clarify. Now that we move active

Re: [Freedreno] [PATCH v3] drm/dp_mst: Fix return code on sideband message failure

2021-07-27 Thread Lyude Paul
Nice timing, you literally got me as I was 2 minutes away from leaving work for the day :P. I will go ahead and push it now. BTW - in the future I recommend using dim to add Fixes: tags as it'll add Cc: to stable as appropriate (this patch in particular should be Cc: sta...@vger.kernel.org #

Re: [Freedreno] [PATCH v3] drm/dp_mst: Fix return code on sideband message failure

2021-07-27 Thread khsieh
On 2021-07-27 12:21, Lyude Paul wrote: On Thu, 2021-07-22 at 15:28 -0700, khs...@codeaurora.org wrote: It looks like this patch is good to go (mainlined). Anything needed from me to do? Thanks, Do you have access for pushing this patch? If not let me know and I can go ahead and push it to

Re: [Freedreno] [PATCH v2 2/3] drm/msm: Split out get_freq() helper

2021-07-27 Thread Dmitry Baryshkov
On 26/07/2021 17:46, Rob Clark wrote: From: Rob Clark In the next patch, it grows a bit more, so lets not duplicate the logic in multiple places. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_gpu_devfreq.c | 21 ++--- 1 file

Re: [Freedreno] [PATCH v2 1/3] drm/msm: Split out devfreq handling

2021-07-27 Thread Dmitry Baryshkov
On 26/07/2021 17:46, Rob Clark wrote: From: Rob Clark Before we start adding more cleverness, split it into it's own file. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/Makefile | 1 + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 +-

Re: [Freedreno] [PATCH 00/14] drm: Make DRM's IRQ helpers legacy

2021-07-27 Thread Sam Ravnborg
Hi Thomas, On Tue, Jul 27, 2021 at 08:27:07PM +0200, Thomas Zimmermann wrote: > DRM's IRQ helpers are only helpful for old, non-KMS drivers. Move > the code behind CONFIG_DRM_LEGACY. Convert KMS drivers to Linux > IRQ interfaces. > > DRM provides IRQ helpers for setting up, receiving and

Re: [Freedreno] [PATCH 2/5] drm/msm/dp: Modify prototype of encoder based API

2021-07-27 Thread Dmitry Baryshkov
On 25/07/2021 07:24, Bjorn Andersson wrote: Functions in the DisplayPort code that relates to individual instances (encoders) are passed both the struct msm_dp and the struct drm_encoder. But in a situation where multiple DP instances would exist this means that the caller need to resolve which

[Freedreno] [PATCH 14/14] drm: IRQ midlayer is now legacy

2021-07-27 Thread Thomas Zimmermann
Hide the DRM midlayer behind CONFIG_DRM_LEGACY, make functions use the prefix drm_legacy_, and move declarations to drm_legacy.h. In struct drm_device, move the fields irq and irq_enabled behind CONFIG_DRM_LEGACY. All callers have been updated. Signed-off-by: Thomas Zimmermann ---

[Freedreno] [PATCH 13/14] drm: Remove unused devm_drm_irq_install()

2021-07-27 Thread Thomas Zimmermann
DRM IRQ helpers will become legacy. The function devm_drm_irq_install() is unused and won't be required later. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_irq.c | 32 include/drm/drm_irq.h | 1 - 2 files changed, 33 deletions(-) diff --git

[Freedreno] [PATCH 12/14] drm/vc4: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort

[Freedreno] [PATCH 11/14] drm/tilcdc: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort

[Freedreno] [PATCH 09/14] drm/radeon: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/radeon_drv.c

[Freedreno] [PATCH 06/14] drm/kmb: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/kmb/kmb_drv.c | 26

[Freedreno] [PATCH 08/14] drm/mxsfb: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort

[Freedreno] [PATCH 10/14] drm/tidss: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tidss/tidss_drv.c |

[Freedreno] [PATCH 03/14] drm/atmel-hlcdc: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann ---

[Freedreno] [PATCH 05/14] drm/gma500: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/gma500/power.c | 1

[Freedreno] [PATCH 07/14] drm/msm: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/msm/msm_drv.c | 113

[Freedreno] [PATCH 04/14] drm/fsl-dcu: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Signed-off-by: Thomas Zimmermann ---

[Freedreno] [PATCH 02/14] drm/arm/hdlcd: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. Calls to platform_get_irq() can fail with a negative errno code. Abort

[Freedreno] [PATCH 00/14] drm: Make DRM's IRQ helpers legacy

2021-07-27 Thread Thomas Zimmermann
DRM's IRQ helpers are only helpful for old, non-KMS drivers. Move the code behind CONFIG_DRM_LEGACY. Convert KMS drivers to Linux IRQ interfaces. DRM provides IRQ helpers for setting up, receiving and removing IRQ handlers. It's an abstraction over plain Linux functions. The code is mid-layerish

[Freedreno] [PATCH 01/14] drm/amdgpu: Convert to Linux IRQ interfaces

2021-07-27 Thread Thomas Zimmermann
Drop the DRM IRQ midlayer in favor of Linux IRQ interfaces. DRM's IRQ helpers are mostly useful for UMS drivers. Modern KMS drivers don't benefit from using it. DRM IRQ callbacks are now being called directly or inlined. The interrupt number returned by pci_msi_vector() is now stored in struct

Re: [Freedreno] [PATCH 1/5] drm/msm/dp: Remove global g_dp_display variable

2021-07-27 Thread Dmitry Baryshkov
On 25/07/2021 07:24, Bjorn Andersson wrote: As the Qualcomm DisplayPort driver only supports a single instance of the driver the commonly used struct dp_display is kept in a global variable. As we introduce additional instances this obviously doesn't work. Replace this with a combination of

Re: [Freedreno] [PATCH v6] drm/msm/dp: add logs across DP driver for ease of debugging

2021-07-27 Thread Stephen Boyd
Quoting maitreye (2021-07-26 17:38:18) > From: Maitreyee Rao > > Add trace points across the MSM DP driver to help debug > interop issues. > > Changes in v2: > - Got rid of redundant log messages. > - Added %#x instead of 0x%x wherever required. > - Got rid of __func__ calls in debug messages.

Re: [Freedreno] [PATCH] drm/msm/dp: Initialize dp->aux->drm_dev before registration

2021-07-27 Thread Dmitry Baryshkov
On 14/07/2021 18:28, Sean Paul wrote: From: Sean Paul Avoids the following WARN: [3.009556] [ cut here ] [3.014306] WARNING: CPU: 7 PID: 109 at drivers/gpu/drm/drm_dp_helper.c:1796 drm_dp_aux_register+0xa4/0xac [3.024209] Modules linked in: [3.027351]

[Freedreno] [PATCH v3 13/13] drm/msm/gem: Mark active before pinning

2021-07-27 Thread Rob Clark
From: Rob Clark Mark all the bos in the submit as active, before pinning, to prevent evicting a buffer in the same submit to make room for a buffer earlier in the table. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gem.c| 2 -- drivers/gpu/drm/msm/msm_gem_submit.c | 28

[Freedreno] [PATCH v3 12/13] drm/msm: Utilize gpu scheduler priorities

2021-07-27 Thread Rob Clark
From: Rob Clark The drm/scheduler provides additional prioritization on top of that provided by however many number of ringbuffers (each with their own priority level) is supported on a given generation. Expose the additional levels of priority to userspace and map the userspace priority back

[Freedreno] [PATCH v3 11/13] drm/msm: Drop struct_mutex in submit path

2021-07-27 Thread Rob Clark
From: Rob Clark It is sufficient to serialize on the submit queue now. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem_submit.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c

[Freedreno] [PATCH v3 10/13] drm/msm: Drop submit bo_list

2021-07-27 Thread Rob Clark
From: Rob Clark This was only used to detect userspace including the same bo multiple times in a submit. But ww_mutex can already tell us this. When we drop struct_mutex around the submit ioctl, we'd otherwise need to lock the bo before adding it to the bo_list. But since ww_mutex can already

[Freedreno] [PATCH v3 09/13] drm/msm: Conversion to drm scheduler

2021-07-27 Thread Rob Clark
From: Rob Clark For existing adrenos, there is one or more ringbuffer, depending on whether preemption is supported. When preemption is supported, each ringbuffer has it's own priority. A submitqueue (which maps to a gl context or vk queue in userspace) is mapped to a specific ring- buffer at

[Freedreno] [PATCH v3 08/13] drm/msm: Return ERR_PTR() from submit_create()

2021-07-27 Thread Rob Clark
From: Rob Clark In the next patch, we start having more than a single potential failure reason. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem_submit.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git

[Freedreno] [PATCH v3 07/13] drm/msm: Track "seqno" fences by idr

2021-07-27 Thread Rob Clark
From: Rob Clark Previously the (non-fd) fence returned from submit ioctl was a raw seqno, which is scoped to the ring. But from UABI standpoint, the ioctls related to seqno fences all specify a submitqueue. We can take advantage of that to replace the seqno fences with a cyclic idr handle.

[Freedreno] [PATCH v3 06/13] drm/msm: Consolidate submit bo state

2021-07-27 Thread Rob Clark
From: Rob Clark Move all the locked/active/pinned state handling to msm_gem_submit.c. In particular, for drm/scheduler, we'll need to do all this before pushing the submit job to the scheduler. But while we're at it we can get rid of the dupicate pin and refcnt. Signed-off-by: Rob Clark

[Freedreno] [PATCH v3 05/13] drm/msm/submit: Simplify out-fence-fd handling

2021-07-27 Thread Rob Clark
From: Rob Clark No need for this to be split in two parts. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem_submit.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c

[Freedreno] [PATCH v3 03/13] drm/msm: drop drm_gem_object_put_locked()

2021-07-27 Thread Rob Clark
From: Rob Clark No idea why we were still using this. It certainly hasn't been needed for some time. So drop the pointless twin codepaths. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.c

[Freedreno] [PATCH v3 02/13] drm/msm: Small submitqueue creation cleanup

2021-07-27 Thread Rob Clark
From: Rob Clark If we don't have a gpu, there is no need to create a submitqueue, which lets us simplify the error handling and submitqueue creation. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_submitqueue.c | 22 +++--- 1 file changed, 11

[Freedreno] [PATCH v3 01/13] drm/msm: Docs and misc cleanup

2021-07-27 Thread Rob Clark
From: Rob Clark Fix a couple incorrect or misspelt comments, and add submitqueue doc comment. Signed-off-by: Rob Clark Acked-by: Christian König --- drivers/gpu/drm/msm/msm_gem.h | 3 +-- drivers/gpu/drm/msm/msm_gem_submit.c | 1 + drivers/gpu/drm/msm/msm_gpu.h | 15

[Freedreno] [PATCH v3 00/13] drm/msm: drm scheduler conversion and cleanups

2021-07-27 Thread Rob Clark
From: Rob Clark Conversion to gpu_scheduler, and bonus removal of drm_gem_object_put_locked() v2: Fix priority mixup (msm UAPI has lower numeric priority value as higher priority, inverse of drm/scheduler) and add some comments in the UAPI header to clarify. Now that we move active

[Freedreno] [pull] drm/msm: drm-msm-fixes-2021-07-27 for v5.14-rc4

2021-07-27 Thread Rob Clark
Hi Dave & Daniel, A few fixes for v5.14, including a fix for a crash if display triggers an iommu fault (which tends to happen at probe time on devices with bootloader fw that leaves display enabled as kernel starts) The following changes since commit ff1176468d368232b684f75e82563369208bc371:

Re: [Freedreno] [PATCH v3] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features

2021-07-27 Thread Nicolas Boichat
On Tue, Jul 27, 2021 at 4:35 PM Sam Ravnborg wrote: > > Hi Nicolas, > On Tue, Jul 27, 2021 at 09:45:21AM +0800, Nicolas Boichat wrote: > > Many of the DSI flags have names opposite to their actual effects, > > e.g. MIPI_DSI_MODE_EOT_PACKET means that EoT packets will actually > > be disabled. Fix

Re: [Freedreno] [PATCH v3] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features

2021-07-27 Thread Sam Ravnborg
Hi Nicolas, On Tue, Jul 27, 2021 at 09:45:21AM +0800, Nicolas Boichat wrote: > Many of the DSI flags have names opposite to their actual effects, > e.g. MIPI_DSI_MODE_EOT_PACKET means that EoT packets will actually > be disabled. Fix this by including _NO_ in the flag names, e.g. >