Re: [PATCH][next] drm/ttm: fix spelling mistake "swaput" -> "swapout"

2020-11-12 Thread Christian König

Am 12.11.20 um 10:50 schrieb Colin King:

From: Colin Ian King 

There is a spelling mistake in a warning message, fix it.

Signed-off-by: Colin Ian King 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index e6bcbfe530ec..d32ca8734aa7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1494,7 +1494,7 @@ int ttm_bo_swapout(struct ttm_operation_ctx *ctx)
  
  		ret = ttm_bo_handle_move_mem(bo, &evict_mem, true, &ctx, &hop);

if (unlikely(ret != 0)) {
-   WARN(ret == -EMULTIHOP, "Unexpected multihop in swaput - 
likely driver bug.\n");
+   WARN(ret == -EMULTIHOP, "Unexpected multihop in swapout - 
likely driver bug.\n");
goto out;
}
}


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 00/19] [Set 2] Rid W=1 warnings from GPU

2020-11-12 Thread Lee Jones
On Fri, 13 Nov 2020, Alex Deucher wrote:

> On Fri, Nov 13, 2020 at 2:19 AM Lee Jones  wrote:
> >
> > On Fri, 06 Nov 2020, Lee Jones wrote:
> >
> > > This set is part of a larger effort attempting to clean-up W=1
> > > kernel builds, which are currently overwhelmingly riddled with
> > > niggly little warnings.
> > >
> > > There are 5000 warnings to work through.  It will take a couple more
> > > sets.  Although, ("drm/amd/display/dc/basics/fixpt31_32: Move
> > > variables to where they're used") does take care of 2000 of them!
> > >
> > > Lee Jones (19):
> > >   drm/ttm/ttm_range_manager: Demote non-conformant kernel-doc header
> > >   drm/r128/ati_pcigart: Source file headers are not good candidates for
> > > kernel-doc
> > >   drm/selftests/test-drm_dp_mst_helper: Move
> > > 'sideband_msg_req_encode_decode' onto the heap
> > >   drm/mga/mga_dma: Demote kernel-doc abusers to standard comment blocks
> > >   drm/mga/mga_state: Remove unused variable 'buf_priv'
> > >   drm/radeon/atom: Move prototype into shared location
> > >   drm/radeon/radeon_kms: Include header containing our own prototypes
> > >   drm/omapdrm/omap_gem: Fix misnamed and missing parameter descriptions
> > >   drm/omapdrm/omap_dmm_tiler: Demote abusive use of kernel-doc format
> > >   drm/radeon/radeon: Move prototype into shared header
> > >   drm/radeon/radeon_drv: Source file headers are not good candidates for
> > > kernel-doc
> > >   drm/amd/display/dc/basics/fixpt31_32: Move variables to where they're
> > > used
> > >   drm/radeon/radeon_drv: Move prototypes to a shared headerfile
> > >   drm/amd/amdgpu/amdgpu_device: Provide documentation for 'reg_addr'
> > > params
> > >   drm/radeon: Move prototypes to shared header
> > >   drm/amd/amdgpu/amdgpu_kms: Remove 'struct drm_amdgpu_info_device
> > > dev_info' from the stack
> > >   drm/radeon/radeon_kms: Fix misnaming of 'radeon_info_ioctl's dev param
> > >   drm/radeon/atombios_crtc: Remove description of non-existent function
> > > param 'encoder'
> > >   drm/v3d/v3d_drv: Remove unused static variable 'v3d_v3d_pm_ops'
> > >
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|   2 +
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c   | 104 +-
> > >  .../drm/amd/display/dc/basics/fixpt31_32.c|   5 +
> > >  .../gpu/drm/amd/display/include/fixed31_32.h  |   6 -
> > >  drivers/gpu/drm/mga/mga_dma.c |  10 +-
> > >  drivers/gpu/drm/mga/mga_state.c   |   2 -
> > >  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c  |   6 +-
> > >  drivers/gpu/drm/omapdrm/omap_gem.c|   3 +-
> > >  drivers/gpu/drm/r128/ati_pcigart.c|   2 +-
> > >  drivers/gpu/drm/radeon/atom.h |   6 +
> > >  drivers/gpu/drm/radeon/atombios_crtc.c|   1 -
> > >  drivers/gpu/drm/radeon/atombios_encoders.c|   4 -
> > >  drivers/gpu/drm/radeon/radeon.h   |   6 +
> > >  drivers/gpu/drm/radeon/radeon_device.c|   1 +
> > >  drivers/gpu/drm/radeon/radeon_device.h|  32 ++
> > >  drivers/gpu/drm/radeon/radeon_display.c   |   4 -
> > >  drivers/gpu/drm/radeon/radeon_drv.c   |  11 +-
> > >  drivers/gpu/drm/radeon/radeon_drv.h   |   7 ++
> > >  drivers/gpu/drm/radeon/radeon_kms.c   |   3 +-
> > >  .../drm/selftests/test-drm_dp_mst_helper.c|  11 +-
> > >  drivers/gpu/drm/ttm/ttm_range_manager.c   |   2 +-
> > >  drivers/gpu/drm/v3d/v3d_drv.c |  36 --
> > >  22 files changed, 138 insertions(+), 126 deletions(-)
> > >  create mode 100644 drivers/gpu/drm/radeon/radeon_device.h
> >
> > Still no Radeon patches in today's -next.
> >
> > I really wanted to have had this set rebased by now.
> >
> > How long do they take to peculate through?
> 
> Usually a day or two, but I was swamped the last couple of days. I
> pushed an updated -next branch today:
> https://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-next

Ah, wonderful.

I'll rebase all of the sets on Monday and see what we're left with.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 00/19] [Set 2] Rid W=1 warnings from GPU

2020-11-12 Thread Alex Deucher
On Fri, Nov 13, 2020 at 2:19 AM Lee Jones  wrote:
>
> On Fri, 06 Nov 2020, Lee Jones wrote:
>
> > This set is part of a larger effort attempting to clean-up W=1
> > kernel builds, which are currently overwhelmingly riddled with
> > niggly little warnings.
> >
> > There are 5000 warnings to work through.  It will take a couple more
> > sets.  Although, ("drm/amd/display/dc/basics/fixpt31_32: Move
> > variables to where they're used") does take care of 2000 of them!
> >
> > Lee Jones (19):
> >   drm/ttm/ttm_range_manager: Demote non-conformant kernel-doc header
> >   drm/r128/ati_pcigart: Source file headers are not good candidates for
> > kernel-doc
> >   drm/selftests/test-drm_dp_mst_helper: Move
> > 'sideband_msg_req_encode_decode' onto the heap
> >   drm/mga/mga_dma: Demote kernel-doc abusers to standard comment blocks
> >   drm/mga/mga_state: Remove unused variable 'buf_priv'
> >   drm/radeon/atom: Move prototype into shared location
> >   drm/radeon/radeon_kms: Include header containing our own prototypes
> >   drm/omapdrm/omap_gem: Fix misnamed and missing parameter descriptions
> >   drm/omapdrm/omap_dmm_tiler: Demote abusive use of kernel-doc format
> >   drm/radeon/radeon: Move prototype into shared header
> >   drm/radeon/radeon_drv: Source file headers are not good candidates for
> > kernel-doc
> >   drm/amd/display/dc/basics/fixpt31_32: Move variables to where they're
> > used
> >   drm/radeon/radeon_drv: Move prototypes to a shared headerfile
> >   drm/amd/amdgpu/amdgpu_device: Provide documentation for 'reg_addr'
> > params
> >   drm/radeon: Move prototypes to shared header
> >   drm/amd/amdgpu/amdgpu_kms: Remove 'struct drm_amdgpu_info_device
> > dev_info' from the stack
> >   drm/radeon/radeon_kms: Fix misnaming of 'radeon_info_ioctl's dev param
> >   drm/radeon/atombios_crtc: Remove description of non-existent function
> > param 'encoder'
> >   drm/v3d/v3d_drv: Remove unused static variable 'v3d_v3d_pm_ops'
> >
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|   2 +
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c   | 104 +-
> >  .../drm/amd/display/dc/basics/fixpt31_32.c|   5 +
> >  .../gpu/drm/amd/display/include/fixed31_32.h  |   6 -
> >  drivers/gpu/drm/mga/mga_dma.c |  10 +-
> >  drivers/gpu/drm/mga/mga_state.c   |   2 -
> >  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c  |   6 +-
> >  drivers/gpu/drm/omapdrm/omap_gem.c|   3 +-
> >  drivers/gpu/drm/r128/ati_pcigart.c|   2 +-
> >  drivers/gpu/drm/radeon/atom.h |   6 +
> >  drivers/gpu/drm/radeon/atombios_crtc.c|   1 -
> >  drivers/gpu/drm/radeon/atombios_encoders.c|   4 -
> >  drivers/gpu/drm/radeon/radeon.h   |   6 +
> >  drivers/gpu/drm/radeon/radeon_device.c|   1 +
> >  drivers/gpu/drm/radeon/radeon_device.h|  32 ++
> >  drivers/gpu/drm/radeon/radeon_display.c   |   4 -
> >  drivers/gpu/drm/radeon/radeon_drv.c   |  11 +-
> >  drivers/gpu/drm/radeon/radeon_drv.h   |   7 ++
> >  drivers/gpu/drm/radeon/radeon_kms.c   |   3 +-
> >  .../drm/selftests/test-drm_dp_mst_helper.c|  11 +-
> >  drivers/gpu/drm/ttm/ttm_range_manager.c   |   2 +-
> >  drivers/gpu/drm/v3d/v3d_drv.c |  36 --
> >  22 files changed, 138 insertions(+), 126 deletions(-)
> >  create mode 100644 drivers/gpu/drm/radeon/radeon_device.h
>
> Still no Radeon patches in today's -next.
>
> I really wanted to have had this set rebased by now.
>
> How long do they take to peculate through?

Usually a day or two, but I was swamped the last couple of days. I
pushed an updated -next branch today:
https://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-next

Alex

>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 00/19] [Set 2] Rid W=1 warnings from GPU

2020-11-12 Thread Lee Jones
On Fri, 06 Nov 2020, Lee Jones wrote:

> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.
> 
> There are 5000 warnings to work through.  It will take a couple more
> sets.  Although, ("drm/amd/display/dc/basics/fixpt31_32: Move
> variables to where they're used") does take care of 2000 of them!
> 
> Lee Jones (19):
>   drm/ttm/ttm_range_manager: Demote non-conformant kernel-doc header
>   drm/r128/ati_pcigart: Source file headers are not good candidates for
> kernel-doc
>   drm/selftests/test-drm_dp_mst_helper: Move
> 'sideband_msg_req_encode_decode' onto the heap
>   drm/mga/mga_dma: Demote kernel-doc abusers to standard comment blocks
>   drm/mga/mga_state: Remove unused variable 'buf_priv'
>   drm/radeon/atom: Move prototype into shared location
>   drm/radeon/radeon_kms: Include header containing our own prototypes
>   drm/omapdrm/omap_gem: Fix misnamed and missing parameter descriptions
>   drm/omapdrm/omap_dmm_tiler: Demote abusive use of kernel-doc format
>   drm/radeon/radeon: Move prototype into shared header
>   drm/radeon/radeon_drv: Source file headers are not good candidates for
> kernel-doc
>   drm/amd/display/dc/basics/fixpt31_32: Move variables to where they're
> used
>   drm/radeon/radeon_drv: Move prototypes to a shared headerfile
>   drm/amd/amdgpu/amdgpu_device: Provide documentation for 'reg_addr'
> params
>   drm/radeon: Move prototypes to shared header
>   drm/amd/amdgpu/amdgpu_kms: Remove 'struct drm_amdgpu_info_device
> dev_info' from the stack
>   drm/radeon/radeon_kms: Fix misnaming of 'radeon_info_ioctl's dev param
>   drm/radeon/atombios_crtc: Remove description of non-existent function
> param 'encoder'
>   drm/v3d/v3d_drv: Remove unused static variable 'v3d_v3d_pm_ops'
> 
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c|   2 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c   | 104 +-
>  .../drm/amd/display/dc/basics/fixpt31_32.c|   5 +
>  .../gpu/drm/amd/display/include/fixed31_32.h  |   6 -
>  drivers/gpu/drm/mga/mga_dma.c |  10 +-
>  drivers/gpu/drm/mga/mga_state.c   |   2 -
>  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c  |   6 +-
>  drivers/gpu/drm/omapdrm/omap_gem.c|   3 +-
>  drivers/gpu/drm/r128/ati_pcigart.c|   2 +-
>  drivers/gpu/drm/radeon/atom.h |   6 +
>  drivers/gpu/drm/radeon/atombios_crtc.c|   1 -
>  drivers/gpu/drm/radeon/atombios_encoders.c|   4 -
>  drivers/gpu/drm/radeon/radeon.h   |   6 +
>  drivers/gpu/drm/radeon/radeon_device.c|   1 +
>  drivers/gpu/drm/radeon/radeon_device.h|  32 ++
>  drivers/gpu/drm/radeon/radeon_display.c   |   4 -
>  drivers/gpu/drm/radeon/radeon_drv.c   |  11 +-
>  drivers/gpu/drm/radeon/radeon_drv.h   |   7 ++
>  drivers/gpu/drm/radeon/radeon_kms.c   |   3 +-
>  .../drm/selftests/test-drm_dp_mst_helper.c|  11 +-
>  drivers/gpu/drm/ttm/ttm_range_manager.c   |   2 +-
>  drivers/gpu/drm/v3d/v3d_drv.c |  36 --
>  22 files changed, 138 insertions(+), 126 deletions(-)
>  create mode 100644 drivers/gpu/drm/radeon/radeon_device.h

Still no Radeon patches in today's -next.

I really wanted to have had this set rebased by now.

How long do they take to peculate through?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[git pull] drm fixes for 5.10-rc4

2020-11-12 Thread Dave Airlie
Hi Linus,

Nearly didn't send you a PR this week at all, but a few things
trickled in over the day, not a huge amount here, some i915, amdgpu
and a bunch of misc fixes. I have a couple of nouveau fixes
outstanding due to the PR having the wrong base, I'll figure it out
next week.

Dave.

drm-fixes-2020-11-13:
drm fixes for 5.10-rc4

amdgpu:
- Pageflip fix for DCN3
- Declare TA firmware for green sardine
- Headless navi fix

i915:
- Pull phys pread/pwrite implementations to the backend
- Correctly set SFC capability for video engines

bridge:
- cdns Kconfig fix

hyperv_fb:
- fix missing include

gma500:
- oob access fix

mcde:
- unbalanced regulator fix
The following changes since commit f8394f232b1eab649ce2df5c5f15b0e528c92091:

  Linux 5.10-rc3 (2020-11-08 16:10:16 -0800)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm tags/drm-fixes-2020-11-13

for you to fetch changes up to 41f3ed2cac86ba533ce6a334a2e7fae5c7082946:

  Merge tag 'amd-drm-fixes-5.10-2020-11-12' of
git://people.freedesktop.org/~agd5f/linux into drm-fixes (2020-11-13
16:05:31 +1000)


drm fixes for 5.10-rc4

amdgpu:
- Pageflip fix for DCN3
- Declare TA firmware for green sardine
- Headless navi fix

i915:
- Pull phys pread/pwrite implementations to the backend
- Correctly set SFC capability for video engines

bridge:
- cdns Kconfig fix

hyperv_fb:
- fix missing include

gma500:
- oob access fix

mcde:
- unbalanced regulator fix


Bhawanpreet Lakha (1):
  drm/amd/display: Add missing pflip irq

Chris Wilson (1):
  drm/i915/gem: Pull phys pread/pwrite implementations to the backend

Dave Airlie (3):
  Merge tag 'drm-misc-fixes-2020-11-12' of
git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
  Merge tag 'drm-intel-fixes-2020-11-13' of
git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
  Merge tag 'amd-drm-fixes-5.10-2020-11-12' of
git://people.freedesktop.org/~agd5f/linux into drm-fixes

Linus Walleij (1):
  drm/mcde: Fix unbalanced regulator

Matthew Auld (1):
  drm/i915/gem: Allow backends to override pread implementation

Nishanth Menon (1):
  drm: bridge: cdns: Kconfig: Switch over dependency to ARCH_K3

Olaf Hering (1):
  video: hyperv_fb: include vmalloc.h

Roman Li (1):
  drm/amdgpu: add ta firmware load for green-sardine

Thomas Zimmermann (1):
  drm/gma500: Fix out-of-bounds access to struct drm_device.vblank[]

Tianci.Yin (1):
  drm/amdgpu: enable DCN for navi10 headless SKU

Venkata Sandeep Dhanalakota (1):
  drm/i915: Correctly set SFC capability for video engines

 drivers/gpu/drm/amd/amdgpu/nv.c|  3 +-
 drivers/gpu/drm/amd/amdgpu/psp_v12_0.c |  1 +
 .../amd/display/dc/irq/dcn30/irq_service_dcn30.c   |  4 +-
 drivers/gpu/drm/bridge/cadence/Kconfig |  2 +-
 drivers/gpu/drm/gma500/psb_irq.c   | 34 +
 drivers/gpu/drm/i915/gem/i915_gem_object_types.h   |  2 +
 drivers/gpu/drm/i915/gem/i915_gem_phys.c   | 55 ++
 drivers/gpu/drm/i915/gt/intel_engine_cs.c  |  3 +-
 drivers/gpu/drm/i915/i915_gem.c| 32 +++--
 drivers/gpu/drm/mcde/mcde_drv.c|  8 +++-
 drivers/video/fbdev/hyperv_fb.c|  1 +
 11 files changed, 90 insertions(+), 55 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PULL] nouveau-fixes 5.10

2020-11-12 Thread Dave Airlie
On Thu, 12 Nov 2020 at 14:12, Ben Skeggs  wrote:
>
> The following changes since commit 512bce50a41c528fa15c4c014293e7bebf018658:
>
>   Merge v5.10-rc3 into drm-next (2020-11-10 14:36:36 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/skeggsb/linux linux-5.10
>
> for you to fetch changes up to f67e5ecab785631cf7f776533432ba5aba06615a:
>
>   drm/nouveau/ttm: avoid using nouveau_drm.ttm.type_vram prior to nv50
> (2020-11-12 14:09:45 +1000)

Are these fixes for next or for fixes, since they are on a next base,
I didn't want to assume anything, if they are for v5.10 please base
them on v5.10-rc3 directly.

Dave.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[pull] amdgpu drm-fixes-5.10

2020-11-12 Thread Alex Deucher
Hi Dave, Daniel,

Fixes for 5.10.

The following changes since commit 4241b0411c60a97f87a25ff4da92dac53beb3039:

  drm/amdgpu/display: remove DRM_AMD_DC_GREEN_SARDINE (2020-11-04 08:43:50 
-0500)

are available in the Git repository at:

  git://people.freedesktop.org/~agd5f/linux tags/amd-drm-fixes-5.10-2020-11-12

for you to fetch changes up to 38a2509184952f799d465b26279ef1bd36fb8277:

  drm/amdgpu: enable DCN for navi10 headless SKU (2020-11-13 00:30:05 -0500)


amd-drm-fixes-5.10-2020-11-12:

amdgpu:
- Pageflip fix for DCN3
- Declare TA firmware for green sardine
- Headless navi fix


Bhawanpreet Lakha (1):
  drm/amd/display: Add missing pflip irq

Roman Li (1):
  drm/amdgpu: add ta firmware load for green-sardine

Tianci.Yin (1):
  drm/amdgpu: enable DCN for navi10 headless SKU

 drivers/gpu/drm/amd/amdgpu/nv.c  | 3 +--
 drivers/gpu/drm/amd/amdgpu/psp_v12_0.c   | 1 +
 drivers/gpu/drm/amd/display/dc/irq/dcn30/irq_service_dcn30.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PULL] drm-intel-fixes

2020-11-12 Thread Rodrigo Vivi
Hi Dave and Daniel,

Here it goes again, but wow with the right base.

Please note that one of the patches is only a dependency
that allows the pread override by backend.

Thanks,
Rodrigo.

drm-intel-fixes-2020-11-13:

- Pull phys pread/pwrite implementations to the backend (Chris)
- Correctly set SFC capability for video engines (Venkata)

The following changes since commit f8394f232b1eab649ce2df5c5f15b0e528c92091:

  Linux 5.10-rc3 (2020-11-08 16:10:16 -0800)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-intel tags/drm-intel-fixes-2020-11-13

for you to fetch changes up to 5ce6861d36ed5207aff9e5eead4c7cc38a986586:

  drm/i915: Correctly set SFC capability for video engines (2020-11-12 19:47:30 
-0500)


- Pull phys pread/pwrite implementations to the backend (Chris)
- Correctly set SFC capability for video engines (Venkata)


Chris Wilson (1):
  drm/i915/gem: Pull phys pread/pwrite implementations to the backend

Matthew Auld (1):
  drm/i915/gem: Allow backends to override pread implementation

Venkata Sandeep Dhanalakota (1):
  drm/i915: Correctly set SFC capability for video engines

 drivers/gpu/drm/i915/gem/i915_gem_object_types.h |  2 +
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 55 
 drivers/gpu/drm/i915/gt/intel_engine_cs.c|  3 +-
 drivers/gpu/drm/i915/i915_gem.c  | 32 +++---
 4 files changed, 65 insertions(+), 27 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/i915/gvt: return error when failing to take the module reference

2020-11-12 Thread Zhenyu Wang
On 2020.11.12 21:22:32 +0800, Xiongfeng Wang wrote:
> When we fail to take the module reference, we go to the 'undo*' branch and
> return. But the returned variable 'ret' has been set as zero by the
> above code. Change 'ret' to '-ENODEV' in this situation.
> 
> Fixes: 9bdb073464d6 ("drm/i915/gvt: Change KVMGT as self load module")
> Reported-by: Hulk Robot 
> Signed-off-by: Xiongfeng Wang 
> ---
>  drivers/gpu/drm/i915/gvt/kvmgt.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c 
> b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index ad8a9df..778eb8c 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -829,8 +829,10 @@ static int intel_vgpu_open(struct mdev_device *mdev)
>   /* Take a module reference as mdev core doesn't take
>* a reference for vendor driver.
>*/
> - if (!try_module_get(THIS_MODULE))
> + if (!try_module_get(THIS_MODULE)) {
> + ret = -ENODEV;
>   goto undo_group;
> + }
>  
>   ret = kvmgt_guest_init(mdev);
>   if (ret)
> -- 

Thanks for the fix!

Reviewed-by: Zhenyu Wang 

-- 

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v5 0/7] dma-buf: Performance improvements for system heap & a system-uncached implementation

2020-11-12 Thread John Stultz
On Thu, Nov 12, 2020 at 1:32 AM Daniel Vetter  wrote:
> On Thu, Nov 12, 2020 at 11:09:04AM +0530, Sumit Semwal wrote:
> > On Tue, 10 Nov 2020 at 09:19, John Stultz  wrote:
> > >
> > > Hey All,
> > >   So just wanted to send my last revision of my patch series
> > > of performance optimizations to the dma-buf system heap.
> >
> > Thanks very much for your patches - I think the first 5 patches look good 
> > to me.
> >
> > I know there was a bit of discussion over adding a new system-uncached
> > heap v/s using a flag to identify that; I think I prefer the separate
> > heap idea, but lets ask one last time if any one else has any real
> > objections to it.
> >
> > Daniel, Christian: any comments from your side on this?
>
> I do wonder a bit where the userspace stack for this all is, since tuning
> allocators without a full stack is fairly pointless. dma-buf heaps is a
> bit in a limbo situation here it feels like.

As mentioned in the system-uncached patch:
Pending opensource users of this code include:
* AOSP HiKey960 gralloc:
  - https://android-review.googlesource.com/c/device/linaro/hikey/+/1399519
  - Visibly improves performance over the system heap
* AOSP Codec2 (possibly, needs more review):
  - 
https://android-review.googlesource.com/c/platform/frameworks/av/+/1360640/17/media/codec2/vndk/C2DmaBufAllocator.cpp#325

Additionally both the HiKey, HiKey960 grallocs  and Codec2 are already
able to use the current dmabuf heaps instead of ION.

So I'm not sure what you mean by limbo, other than it being in a
transition state where the interface is upstream and we're working on
moving vendors to it from ION (which is staged to be dropped in 5.11).
Part of that work is making sure we don't regress the performance
expectations.

> Plus I'm vary of anything related to leaking this kind of stuff beyond the
> dma-api because dma api maintainers don't like us doing that. But
> personally no concern on that front really, gpus need this. It's just that
> we do need solid justification I think if we land this. Hence back to
> first point.
>
> Ideally first point comes in the form of benchmarking on android together
> with a mesa driver (or mesa + some v4l driver or whatever it takes to
> actually show the benefits, I have no idea).

Tying it with mesa is a little tough as the grallocs for mesa devices
usually use gbm (gralloc.gbm or gralloc.minigbm). Swapping the
allocation path for dmabuf heaps there gets a little complex as last I
tried that (when trying to get HiKey working with Lima graphics, as
gbm wouldn't allocate the contiguous buffers required by the display),
I ran into issues with the drm_hwcomposer and mesa expecting the gbm
private handle metadata in the buffer when it was passed in.

But I might take a look at it again. I got a bit lost digging through
the mesa gbm allocation paths last time.

I'll also try to see if I can find a benchmark for the codec2 code
(using dmabuf heaps with and without the uncached heap) on on db845c
(w/ mesa), as that is already working and I suspect that might be
close to what you're looking for.

thanks
-john
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


RE: [PATCH v10 3/6] RDMA/uverbs: Add uverbs command for dma-buf based MR registration

2020-11-12 Thread Xiong, Jianxin
> -Original Message-
> From: Jason Gunthorpe 
> Sent: Thursday, November 12, 2020 4:34 PM
> To: Xiong, Jianxin 
> Cc: linux-r...@vger.kernel.org; dri-devel@lists.freedesktop.org; Doug Ledford 
> ; Leon Romanovsky
> ; Sumit Semwal ; Christian Koenig 
> ; Vetter, Daniel
> 
> Subject: Re: [PATCH v10 3/6] RDMA/uverbs: Add uverbs command for dma-buf 
> based MR registration
> 
> On Tue, Nov 10, 2020 at 01:41:14PM -0800, Jianxin Xiong wrote:
> > +   mr = pd->device->ops.reg_user_mr_dmabuf(pd, offset, length, virt_addr,
> > +   fd, access_flags,
> > +   &attrs->driver_udata);
> > +   if (IS_ERR(mr))
> > +   return PTR_ERR(mr);
> > +
> > +   mr->device = pd->device;
> > +   mr->pd = pd;
> > +   mr->type = IB_MR_TYPE_USER;
> > +   mr->uobject = uobj;
> > +   atomic_inc(&pd->usecnt);
> > +
> > +   uobj->object = mr;
> > +
> > +   uverbs_finalize_uobj_create(attrs,
> > +UVERBS_ATTR_REG_DMABUF_MR_HANDLE);
> > +
> > +   ret = uverbs_copy_to(attrs, UVERBS_ATTR_REG_DMABUF_MR_RESP_LKEY,
> > +&mr->lkey, sizeof(mr->lkey));
> > +   if (ret)
> > +   goto err_dereg;
> > +
> > +   ret = uverbs_copy_to(attrs, UVERBS_ATTR_REG_DMABUF_MR_RESP_RKEY,
> > +&mr->rkey, sizeof(mr->rkey));
> > +   if (ret)
> > +   goto err_dereg;
> > +
> > +   return 0;
> > +
> > +err_dereg:
> > +   ib_dereg_mr_user(mr, uverbs_get_cleared_udata(attrs));
> 
> This isn't how the error handling works with
> uverbs_finalize_uobj_create() - you just return the error code and the caller 
> deals with destroying the fully initialized HW object properly.
> Calling ib_dereg_mr_user() here will crash the kernel.
> 
> Check the other uses for an example.
> 

Will fix.

> Again I must ask what the plan is for testing as even a basic set of pyverbs 
> sanity tests would catch this.
> 
> I've generally been insisting that all new uABI needs testing support in 
> rdma-core. This *might* be the exception but I want to hear a really
> good reason why we can't have a test first...
> 

So far I have been using a user space test that focuses on basic functionality 
and limited parameter checking (e.g. incorrect addr, length, flags). This 
specific error path happens
to be untested. Will work more on the test front to increase the code coverage.

> Jason
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


RE: [PATCH v10 4/6] RDMA/mlx5: Support dma-buf based userspace memory region

2020-11-12 Thread Xiong, Jianxin
> -Original Message-
> From: Jason Gunthorpe 
> Sent: Thursday, November 12, 2020 4:40 PM
> To: Xiong, Jianxin 
> Cc: linux-r...@vger.kernel.org; dri-devel@lists.freedesktop.org; Doug Ledford 
> ; Leon Romanovsky
> ; Sumit Semwal ; Christian Koenig 
> ; Vetter, Daniel
> 
> Subject: Re: [PATCH v10 4/6] RDMA/mlx5: Support dma-buf based userspace 
> memory region
> 
> On Tue, Nov 10, 2020 at 01:41:15PM -0800, Jianxin Xiong wrote:
> 
> > -static int mlx5_ib_update_mr_pas(struct mlx5_ib_mr *mr, unsigned int
> > flags)
> > +int mlx5_ib_update_mr_pas(struct mlx5_ib_mr *mr, unsigned int flags)
> >  {
> > struct mlx5_ib_dev *dev = mr->dev;
> > struct device *ddev = dev->ib_dev.dev.parent; @@ -1255,6 +1267,10 @@
> > static int mlx5_ib_update_mr_pas(struct mlx5_ib_mr *mr, unsigned int flags)
> > cur_mtt->ptag =
> > cpu_to_be64(rdma_block_iter_dma_address(&biter) |
> > MLX5_IB_MTT_PRESENT);
> > +
> > +   if (mr->umem->is_dmabuf && (flags & MLX5_IB_UPD_XLT_ZAP))
> > +   cur_mtt->ptag = 0;
> > +
> > cur_mtt++;
> > }
> >
> > @@ -1291,8 +1307,15 @@ static struct mlx5_ib_mr *reg_create(struct ib_mr 
> > *ibmr, struct ib_pd *pd,
> > int err;
> > bool pg_cap = !!(MLX5_CAP_GEN(dev->mdev, pg));
> >
> > -   page_size =
> > -   mlx5_umem_find_best_pgsz(umem, mkc, log_page_size, 0, iova);
> > +   if (umem->is_dmabuf) {
> > +   if ((iova ^ umem->address) & (PAGE_SIZE - 1))
> > +   return ERR_PTR(-EINVAL);
> > +   umem->iova = iova;
> > +   page_size = PAGE_SIZE;
> > +   } else {
> > +   page_size = mlx5_umem_find_best_pgsz(umem, mkc, log_page_size,
> > +0, iova);
> > +   }
> 
> Urk, maybe this duplicated sequence should be in a function..
> 
> This will also collide with a rereg_mr bugfixing series that should be posted 
> soon..
> 
> > +static void mlx5_ib_dmabuf_invalidate_cb(struct dma_buf_attachment
> > +*attach) {
> > +   struct ib_umem_dmabuf *umem_dmabuf = attach->importer_priv;
> > +   struct mlx5_ib_mr *mr = umem_dmabuf->private;
> > +
> > +   dma_resv_assert_held(umem_dmabuf->attach->dmabuf->resv);
> > +
> > +   if (mr)
> 
> I don't think this 'if (mr)' test is needed anymore? I certainly prefer it 
> gone as it is kind of messy. I expect unmapping the dma to ensure this
> function is not running, and won't run again.

It is still needed. When the dma-buf moves, the callback function of every 
attached importer is invoked, regardless if the importer has mapped the dma or 
not.

> 
> > +/**
> > + * mlx5_ib_fence_dmabuf_mr - Stop all access to the dmabuf MR
> > + * @mr: to fence
> > + *
> > + * On return no parallel threads will be touching this MR and no DMA
> > +will be
> > + * active.
> > + */
> > +void mlx5_ib_fence_dmabuf_mr(struct mlx5_ib_mr *mr) {
> > +   struct ib_umem_dmabuf *umem_dmabuf = to_ib_umem_dmabuf(mr->umem);
> > +
> > +   /* Prevent new page faults and prefetch requests from succeeding */
> > +   xa_erase(&mr->dev->odp_mkeys, mlx5_base_mkey(mr->mmkey.key));
> > +
> > +   /* Wait for all running page-fault handlers to finish. */
> > +   synchronize_srcu(&mr->dev->odp_srcu);
> > +
> > +   wait_event(mr->q_deferred_work,
> > +!atomic_read(&mr->num_deferred_work));
> > +
> > +   dma_resv_lock(umem_dmabuf->attach->dmabuf->resv, NULL);
> > +   mlx5_mr_cache_invalidate(mr);
> > +   umem_dmabuf->private = NULL;
> > +   ib_umem_dmabuf_unmap_pages(umem_dmabuf);
> > +   dma_resv_unlock(umem_dmabuf->attach->dmabuf->resv);
> > +
> > +   if (!mr->cache_ent) {
> > +   mlx5_core_destroy_mkey(mr->dev->mdev, &mr->mmkey);
> > +   WARN_ON(mr->descs);
> > +   }
> 
> I didn't check carefully, but are you sure this destroy_mkey should be here??

To my understanding, yes. This is similar to what dma_fence_odp_mr() does,
just inlined here since it's not called from other places.
 
> 
> Jason
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


RE: [PATCH v10 1/6] RDMA/umem: Support importing dma-buf as user memory region

2020-11-12 Thread Xiong, Jianxin
> -Original Message-
> From: Jason Gunthorpe 
> Sent: Thursday, November 12, 2020 4:31 PM
> To: Xiong, Jianxin 
> Cc: linux-r...@vger.kernel.org; dri-devel@lists.freedesktop.org; Doug Ledford 
> ; Leon Romanovsky
> ; Sumit Semwal ; Christian Koenig 
> ; Vetter, Daniel
> 
> Subject: Re: [PATCH v10 1/6] RDMA/umem: Support importing dma-buf as user 
> memory region
> 
> On Tue, Nov 10, 2020 at 01:41:12PM -0800, Jianxin Xiong wrote:
> > +struct ib_umem *ib_umem_dmabuf_get(struct ib_device *device,
> > +  unsigned long offset, size_t size,
> > +  int fd, int access,
> > +  const struct dma_buf_attach_ops *ops) {
> > +   struct dma_buf *dmabuf;
> > +   struct ib_umem_dmabuf *umem_dmabuf;
> > +   struct ib_umem *umem;
> > +   unsigned long end;
> > +   long ret;
> > +
> > +   if (check_add_overflow(offset, (unsigned long)size, &end))
> > +   return ERR_PTR(-EINVAL);
> > +
> > +   if (unlikely(PAGE_ALIGN(end) < PAGE_SIZE))
> > +   return ERR_PTR(-EINVAL);
> 
> This is weird, what does it do?

This sequence is modeled after the following code from ib_umem_init_odp():

if (check_add_overflow(umem_odp->umem.address,
   (unsigned long)umem_odp->umem.length,
   &end))
return -EOVERFLOW;
end = ALIGN(end, page_size);
if (unlikely(end < page_size))
return -EOVERFLOW;

The weird part seems to be checking if 'end' is 0, but that should have been 
covered
by check_add_overflow() already.

> 
> > +
> > +   if (unlikely(!ops || !ops->move_notify))
> > +   return ERR_PTR(-EINVAL);
> > +
> > +   umem_dmabuf = kzalloc(sizeof(*umem_dmabuf), GFP_KERNEL);
> > +   if (!umem_dmabuf)
> > +   return ERR_PTR(-ENOMEM);
> > +
> > +   umem = &umem_dmabuf->umem;
> > +   umem->ibdev = device;
> > +   umem->length = size;
> > +   umem->address = offset;
> > +   umem->writable = ib_access_writable(access);
> > +   umem->is_dmabuf = 1;
> > +
> > +   if (unlikely(!ib_umem_num_pages(umem))) {
> > +   ret = -EINVAL;
> > +   goto out_free_umem;
> > +   }
> > +
> > +   dmabuf = dma_buf_get(fd);
> > +   if (IS_ERR(dmabuf)) {
> > +   ret = PTR_ERR(dmabuf);
> > +   goto out_free_umem;
> > +   }
> > +
> > +   if (dmabuf->size < offset + size) {
> > +   ret = -EINVAL;
> > +   goto out_release_dmabuf;
> 
> offset + size == end, already computed, in fact move this above the kzalloc
> 
> Jason
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PULL] drm-intel-fixes

2020-11-12 Thread Vivi, Rodrigo



> On Nov 12, 2020, at 4:32 PM, Dave Airlie  wrote:
> 
> On Fri, 13 Nov 2020 at 09:08, Rodrigo Vivi  wrote:
>> 
>> Hi Dave and Daniel,
>> 
>> This is the same set as last week + couple new fixes targeting stable.
>> 
> 
> But I merged last weeks set and it's in rc3, maybe you can generate
> the pull request relative to origin/master or drm/drm-fixes because
> I'm not sure which bits to edit out here.

oh, of course... bad rebase on my part. Sorry...
Please ignore this one. I'm going to generate another one soon.

> 
> Dave.
> 
>> Thanks,
>> Rodrigo.
>> 
>> drm-intel-fixes-2020-11-12-1:
>> - GVT fixes including vGPU suspend/resume fixes and workaround for APL guest 
>> GPU hang.
>> - Fix set domain's cache coherency (Chris)
>> - Fixes around breadcrumbs (Chris)
>> - Fix encoder lookup during PSR atomic (Imre)
>> - Hold onto an explicit ref to i915_vma_work.pinned (Chris)
>> - Pull phys pread/pwrite implementations to the backend (Chris)
>> - Correctly set SFC capability for video engines
>> The following changes since commit 3cea11cd5e3b00d91caf0b4730194039b45c5891:
>> 
>>  Linux 5.10-rc2 (2020-11-01 14:43:51 -0800)
>> 
>> are available in the Git repository at:
>> 
>>  git://anongit.freedesktop.org/drm/drm-intel 
>> tags/drm-intel-fixes-2020-11-12-1
>> 
>> for you to fetch changes up to a4264790f4c2f0062d27d8173344c914bc7884e0:
>> 
>>  drm/i915: Correctly set SFC capability for video engines (2020-11-12 
>> 16:41:54 -0500)
>> 
>> 
>> - GVT fixes including vGPU suspend/resume fixes and workaround for APL guest 
>> GPU hang.
>> - Fix set domain's cache coherency (Chris)
>> - Fixes around breadcrumbs (Chris)
>> - Fix encoder lookup during PSR atomic (Imre)
>> - Hold onto an explicit ref to i915_vma_work.pinned (Chris)
>> - Pull phys pread/pwrite implementations to the backend (Chris)
>> - Correctly set SFC capability for video engines
>> 
>> 
>> Chris Wilson (6):
>>  drm/i915/gem: Flush coherency domains on first set-domain-ioctl
>>  drm/i915/gt: Use the local HWSP offset during submission
>>  drm/i915/gt: Expose more parameters for emitting writes into the ring
>>  drm/i915/gt: Flush xcs before tgl breadcrumbs
>>  drm/i915: Hold onto an explicit ref to i915_vma_work.pinned
>>  drm/i915/gem: Pull phys pread/pwrite implementations to the backend
>> 
>> Colin Xu (4):
>>  drm/i915/gvt: Allow zero out HWSP addr on hws_pga_write
>>  drm/i915/gvt: Set SNOOP for PAT3 on BXT/APL to workaround GPU BB hang
>>  drm/i915/gvt: Only pin/unpin intel_context along with workload
>>  drm/i915/gvt: Fix mmio handler break on BXT/APL.
>> 
>> Imre Deak (1):
>>  drm/i915: Fix encoder lookup during PSR atomic check
>> 
>> Matthew Auld (1):
>>  drm/i915/gem: Allow backends to override pread implementation
>> 
>> Venkata Sandeep Dhanalakota (1):
>>  drm/i915: Correctly set SFC capability for video engines
>> 
>> drivers/gpu/drm/i915/display/intel_psr.c |  2 +-
>> drivers/gpu/drm/i915/gem/i915_gem_domain.c   | 28 ++--
>> drivers/gpu/drm/i915/gem/i915_gem_object_types.h |  2 +
>> drivers/gpu/drm/i915/gem/i915_gem_phys.c | 55 
>> 
>> drivers/gpu/drm/i915/gt/intel_engine.h   | 55 
>> +++-
>> drivers/gpu/drm/i915/gt/intel_engine_cs.c|  3 +-
>> drivers/gpu/drm/i915/gt/intel_lrc.c  | 31 +
>> drivers/gpu/drm/i915/gt/intel_timeline.c | 18 
>> drivers/gpu/drm/i915/gt/intel_timeline_types.h   |  2 +
>> drivers/gpu/drm/i915/gvt/handlers.c  | 47 ++--
>> drivers/gpu/drm/i915/gvt/scheduler.c | 15 ---
>> drivers/gpu/drm/i915/i915_gem.c  | 32 +++---
>> drivers/gpu/drm/i915/i915_vma.c  |  6 ++-
>> 13 files changed, 204 insertions(+), 92 deletions(-)

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PULL] drm-intel-fixes

2020-11-12 Thread Dave Airlie
On Fri, 13 Nov 2020 at 09:08, Rodrigo Vivi  wrote:
>
> Hi Dave and Daniel,
>
> This is the same set as last week + couple new fixes targeting stable.
>

But I merged last weeks set and it's in rc3, maybe you can generate
the pull request relative to origin/master or drm/drm-fixes because
I'm not sure which bits to edit out here.

Dave.

> Thanks,
> Rodrigo.
>
> drm-intel-fixes-2020-11-12-1:
> - GVT fixes including vGPU suspend/resume fixes and workaround for APL guest 
> GPU hang.
> - Fix set domain's cache coherency (Chris)
> - Fixes around breadcrumbs (Chris)
> - Fix encoder lookup during PSR atomic (Imre)
> - Hold onto an explicit ref to i915_vma_work.pinned (Chris)
> - Pull phys pread/pwrite implementations to the backend (Chris)
> - Correctly set SFC capability for video engines
> The following changes since commit 3cea11cd5e3b00d91caf0b4730194039b45c5891:
>
>   Linux 5.10-rc2 (2020-11-01 14:43:51 -0800)
>
> are available in the Git repository at:
>
>   git://anongit.freedesktop.org/drm/drm-intel 
> tags/drm-intel-fixes-2020-11-12-1
>
> for you to fetch changes up to a4264790f4c2f0062d27d8173344c914bc7884e0:
>
>   drm/i915: Correctly set SFC capability for video engines (2020-11-12 
> 16:41:54 -0500)
>
> 
> - GVT fixes including vGPU suspend/resume fixes and workaround for APL guest 
> GPU hang.
> - Fix set domain's cache coherency (Chris)
> - Fixes around breadcrumbs (Chris)
> - Fix encoder lookup during PSR atomic (Imre)
> - Hold onto an explicit ref to i915_vma_work.pinned (Chris)
> - Pull phys pread/pwrite implementations to the backend (Chris)
> - Correctly set SFC capability for video engines
>
> 
> Chris Wilson (6):
>   drm/i915/gem: Flush coherency domains on first set-domain-ioctl
>   drm/i915/gt: Use the local HWSP offset during submission
>   drm/i915/gt: Expose more parameters for emitting writes into the ring
>   drm/i915/gt: Flush xcs before tgl breadcrumbs
>   drm/i915: Hold onto an explicit ref to i915_vma_work.pinned
>   drm/i915/gem: Pull phys pread/pwrite implementations to the backend
>
> Colin Xu (4):
>   drm/i915/gvt: Allow zero out HWSP addr on hws_pga_write
>   drm/i915/gvt: Set SNOOP for PAT3 on BXT/APL to workaround GPU BB hang
>   drm/i915/gvt: Only pin/unpin intel_context along with workload
>   drm/i915/gvt: Fix mmio handler break on BXT/APL.
>
> Imre Deak (1):
>   drm/i915: Fix encoder lookup during PSR atomic check
>
> Matthew Auld (1):
>   drm/i915/gem: Allow backends to override pread implementation
>
> Venkata Sandeep Dhanalakota (1):
>   drm/i915: Correctly set SFC capability for video engines
>
>  drivers/gpu/drm/i915/display/intel_psr.c |  2 +-
>  drivers/gpu/drm/i915/gem/i915_gem_domain.c   | 28 ++--
>  drivers/gpu/drm/i915/gem/i915_gem_object_types.h |  2 +
>  drivers/gpu/drm/i915/gem/i915_gem_phys.c | 55 
> 
>  drivers/gpu/drm/i915/gt/intel_engine.h   | 55 
> +++-
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c|  3 +-
>  drivers/gpu/drm/i915/gt/intel_lrc.c  | 31 +
>  drivers/gpu/drm/i915/gt/intel_timeline.c | 18 
>  drivers/gpu/drm/i915/gt/intel_timeline_types.h   |  2 +
>  drivers/gpu/drm/i915/gvt/handlers.c  | 47 ++--
>  drivers/gpu/drm/i915/gvt/scheduler.c | 15 ---
>  drivers/gpu/drm/i915/i915_gem.c  | 32 +++---
>  drivers/gpu/drm/i915/i915_vma.c  |  6 ++-
>  13 files changed, 204 insertions(+), 92 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PULL] drm-intel-fixes

2020-11-12 Thread Rodrigo Vivi
Hi Dave and Daniel,

This is the same set as last week + couple new fixes targeting stable.

Thanks,
Rodrigo.

drm-intel-fixes-2020-11-12-1:
- GVT fixes including vGPU suspend/resume fixes and workaround for APL guest 
GPU hang.
- Fix set domain's cache coherency (Chris)
- Fixes around breadcrumbs (Chris)
- Fix encoder lookup during PSR atomic (Imre)
- Hold onto an explicit ref to i915_vma_work.pinned (Chris)
- Pull phys pread/pwrite implementations to the backend (Chris)
- Correctly set SFC capability for video engines
The following changes since commit 3cea11cd5e3b00d91caf0b4730194039b45c5891:

  Linux 5.10-rc2 (2020-11-01 14:43:51 -0800)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-intel tags/drm-intel-fixes-2020-11-12-1

for you to fetch changes up to a4264790f4c2f0062d27d8173344c914bc7884e0:

  drm/i915: Correctly set SFC capability for video engines (2020-11-12 16:41:54 
-0500)


- GVT fixes including vGPU suspend/resume fixes and workaround for APL guest 
GPU hang.
- Fix set domain's cache coherency (Chris)
- Fixes around breadcrumbs (Chris)
- Fix encoder lookup during PSR atomic (Imre)
- Hold onto an explicit ref to i915_vma_work.pinned (Chris)
- Pull phys pread/pwrite implementations to the backend (Chris)
- Correctly set SFC capability for video engines


Chris Wilson (6):
  drm/i915/gem: Flush coherency domains on first set-domain-ioctl
  drm/i915/gt: Use the local HWSP offset during submission
  drm/i915/gt: Expose more parameters for emitting writes into the ring
  drm/i915/gt: Flush xcs before tgl breadcrumbs
  drm/i915: Hold onto an explicit ref to i915_vma_work.pinned
  drm/i915/gem: Pull phys pread/pwrite implementations to the backend

Colin Xu (4):
  drm/i915/gvt: Allow zero out HWSP addr on hws_pga_write
  drm/i915/gvt: Set SNOOP for PAT3 on BXT/APL to workaround GPU BB hang
  drm/i915/gvt: Only pin/unpin intel_context along with workload
  drm/i915/gvt: Fix mmio handler break on BXT/APL.

Imre Deak (1):
  drm/i915: Fix encoder lookup during PSR atomic check

Matthew Auld (1):
  drm/i915/gem: Allow backends to override pread implementation

Venkata Sandeep Dhanalakota (1):
  drm/i915: Correctly set SFC capability for video engines

 drivers/gpu/drm/i915/display/intel_psr.c |  2 +-
 drivers/gpu/drm/i915/gem/i915_gem_domain.c   | 28 ++--
 drivers/gpu/drm/i915/gem/i915_gem_object_types.h |  2 +
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 55 
 drivers/gpu/drm/i915/gt/intel_engine.h   | 55 +++-
 drivers/gpu/drm/i915/gt/intel_engine_cs.c|  3 +-
 drivers/gpu/drm/i915/gt/intel_lrc.c  | 31 +
 drivers/gpu/drm/i915/gt/intel_timeline.c | 18 
 drivers/gpu/drm/i915/gt/intel_timeline_types.h   |  2 +
 drivers/gpu/drm/i915/gvt/handlers.c  | 47 ++--
 drivers/gpu/drm/i915/gvt/scheduler.c | 15 ---
 drivers/gpu/drm/i915/i915_gem.c  | 32 +++---
 drivers/gpu/drm/i915/i915_vma.c  |  6 ++-
 13 files changed, 204 insertions(+), 92 deletions(-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 29/30] drm/amd/amdgpu/atombios_encoders: Remove set but unused variable 'backlight_level'

2020-11-12 Thread Lee Jones
On Thu, 12 Nov 2020, Alex Deucher wrote:

> On Thu, Nov 12, 2020 at 2:01 PM Lee Jones  wrote:
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> >  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c: In function 
> > ‘amdgpu_atombios_encoder_init_backlight’:
> >  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c:174:5: warning: variable 
> > ‘backlight_level’ set but not used [-Wunused-but-set-variable]
> >
> > Cc: Alex Deucher 
> > Cc: "Christian König" 
> > Cc: David Airlie 
> > Cc: Daniel Vetter 
> > Cc: Luben Tuikov 
> > Cc: amd-...@lists.freedesktop.org
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Lee Jones 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c 
> > b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> > index fa817ebff9804..af87505ad7d57 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> > @@ -171,7 +171,6 @@ void amdgpu_atombios_encoder_init_backlight(struct 
> > amdgpu_encoder *amdgpu_encode
> > struct backlight_properties props;
> > struct amdgpu_backlight_privdata *pdata;
> > struct amdgpu_encoder_atom_dig *dig;
> > -   u8 backlight_level;
> > char bl_name[16];
> >
> > /* Mac laptops with multiple GPUs use the gmux driver for backlight
> > @@ -207,7 +206,7 @@ void amdgpu_atombios_encoder_init_backlight(struct 
> > amdgpu_encoder *amdgpu_encode
> >
> > pdata->encoder = amdgpu_encoder;
> >
> > -   backlight_level = 
> > amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
> > +   amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
> 
> We can drop this function call altogether.  We call it again below indirectly.

Will do, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 29/30] drm/amd/amdgpu/atombios_encoders: Remove set but unused variable 'backlight_level'

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 2:01 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c: In function 
> ‘amdgpu_atombios_encoder_init_backlight’:
>  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c:174:5: warning: variable 
> ‘backlight_level’ set but not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Luben Tuikov 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---
>  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c 
> b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> index fa817ebff9804..af87505ad7d57 100644
> --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> @@ -171,7 +171,6 @@ void amdgpu_atombios_encoder_init_backlight(struct 
> amdgpu_encoder *amdgpu_encode
> struct backlight_properties props;
> struct amdgpu_backlight_privdata *pdata;
> struct amdgpu_encoder_atom_dig *dig;
> -   u8 backlight_level;
> char bl_name[16];
>
> /* Mac laptops with multiple GPUs use the gmux driver for backlight
> @@ -207,7 +206,7 @@ void amdgpu_atombios_encoder_init_backlight(struct 
> amdgpu_encoder *amdgpu_encode
>
> pdata->encoder = amdgpu_encoder;
>
> -   backlight_level = 
> amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
> +   amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);

We can drop this function call altogether.  We call it again below indirectly.

Alex

>
> dig = amdgpu_encoder->enc_priv;
> dig->bl_dev = bd;
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 19/30] drm/amd/amdgpu/amdgpu_cs: Add a couple of missing function param descriptions

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 2:07 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:685: warning: Function parameter or 
> member 'backoff' not described in 'amdgpu_cs_parser_fini'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1655: warning: Function parameter or 
> member 'map' not described in 'amdgpu_cs_find_mapping'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: Jerome Glisse 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 8d2878e950dab..594a0108e90fa 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -676,6 +676,7 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser 
> *p)
>   * cs_parser_fini() - clean parser states
>   * @parser:parser structure holding parsing context.
>   * @error: error number
> + * @backoff:   indicator to backoff the reservation
>   *
>   * If error is set than unvalidate buffer, otherwise just free memory
>   * used by parsing context.
> @@ -1644,6 +1645,7 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, 
> void *data,
>   * @parser: command submission parser context
>   * @addr: VM address
>   * @bo: resulting BO of the mapping found
> + * @map: Placeholder to return found BO mapping
>   *
>   * Search the buffer objects in the command submission context for a certain
>   * virtual memory address. Returns allocation structure when found, NULL
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 14/30] drm/amd/amdgpu/amdgpu_ring: Fix a bunch of function misdocumentation

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 2:01 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:63: warning: Excess function 
> parameter 'adev' description in 'amdgpu_ring_alloc'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:122: warning: Excess function 
> parameter 'adev' description in 'amdgpu_ring_commit'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
> member 'max_dw' not described in 'amdgpu_ring_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
> member 'irq_src' not described in 'amdgpu_ring_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
> member 'irq_type' not described in 'amdgpu_ring_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
> member 'hw_prio' not described in 'amdgpu_ring_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Excess function 
> parameter 'max_ndw' description in 'amdgpu_ring_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Excess function 
> parameter 'nop' description in 'amdgpu_ring_init'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:285: warning: Excess function 
> parameter 'adev' description in 'amdgpu_ring_fini'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:325: warning: Function parameter or 
> member 'ring' not described in 'amdgpu_ring_emit_reg_write_reg_wait_helper'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:325: warning: Excess function 
> parameter 'adev' description in 'amdgpu_ring_emit_reg_write_reg_wait_helper'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index 2697b250dc326..a23b2079696a1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -52,7 +52,6 @@
>  /**
>   * amdgpu_ring_alloc - allocate space on the ring buffer
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: amdgpu_ring structure holding ring information
>   * @ndw: number of dwords to allocate in the ring buffer
>   *
> @@ -95,7 +94,8 @@ void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, 
> uint32_t count)
> amdgpu_ring_write(ring, ring->funcs->nop);
>  }
>
> -/** amdgpu_ring_generic_pad_ib - pad IB with NOP packets
> +/**
> + * amdgpu_ring_generic_pad_ib - pad IB with NOP packets
>   *
>   * @ring: amdgpu_ring structure holding ring information
>   * @ib: IB to add NOP packets to
> @@ -112,7 +112,6 @@ void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, 
> struct amdgpu_ib *ib)
>   * amdgpu_ring_commit - tell the GPU to execute the new
>   * commands on the ring buffer
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: amdgpu_ring structure holding ring information
>   *
>   * Update the wptr (write pointer) to tell the GPU to
> @@ -156,7 +155,9 @@ void amdgpu_ring_undo(struct amdgpu_ring *ring)
>   * @adev: amdgpu_device pointer
>   * @ring: amdgpu_ring structure holding ring information
>   * @max_ndw: maximum number of dw for ring alloc
> - * @nop: nop packet for this ring
> + * @irq_src: interrupt source to use for this ring
> + * @irq_type: interrupt type to use for this ring
> + * @hw_prio: ring priority (NORMAL/HIGH)
>   *
>   * Initialize the driver information for the selected ring (all asics).
>   * Returns 0 on success, error on failure.
> @@ -276,7 +277,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct 
> amdgpu_ring *ring,
>  /**
>   * amdgpu_ring_fini - tear down the driver ring struct.
>   *
> - * @adev: amdgpu_device pointer
>   * @ring: amdgpu_ring structure holding ring information
>   *
>   * Tear down the driver information for the selected ring (all asics).
> @@ -310,7 +310,7 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)
>  /**
>   * amdgpu_ring_emit_reg_write_reg_wait_helper - ring helper
>   *
> - * @adev: amdgpu_device pointer
> + * @ring: ring to write to
>   * @reg0: register to write
>   * @reg1: register to wait on
>   * @ref: reference value to write/wait on
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 15/30] drm/amd/amdgpu/amdgpu_display: Remove pointless header

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 2:01 PM Lee Jones  wrote:
>
> It seems only to repeat the function name.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:450: warning: Function parameter 
> or member 'amdgpu_connector' not described in 'amdgpu_display_ddc_probe'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:450: warning: Function parameter 
> or member 'use_aux' not described in 'amdgpu_display_ddc_probe'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: report to 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index 0b134598b3a65..f4de4b41adcfd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -441,10 +441,6 @@ void amdgpu_display_print_display_setup(struct 
> drm_device *dev)
> drm_connector_list_iter_end(&iter);
>  }
>
> -/**
> - * amdgpu_display_ddc_probe
> - *
> - */
>  bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
>   bool use_aux)
>  {
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 12/30] drm/amd/amdgpu/amdgpu_ttm: Demote non-conformant kernel-doc headers, fix slightly lacking ones

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 2:01 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
> member 'bo' not described in 'amdgpu_move_blit'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
> member 'evict' not described in 'amdgpu_move_blit'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
> member 'new_mem' not described in 'amdgpu_move_blit'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
> member 'old_mem' not described in 'amdgpu_move_blit'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:522: warning: Function parameter or 
> member 'adev' not described in 'amdgpu_mem_visible'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:522: warning: Function parameter or 
> member 'mem' not described in 'amdgpu_mem_visible'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
> member 'bo' not described in 'amdgpu_bo_move'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
> member 'evict' not described in 'amdgpu_bo_move'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
> member 'ctx' not described in 'amdgpu_bo_move'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
> member 'new_mem' not described in 'amdgpu_bo_move'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
> member 'hop' not described in 'amdgpu_bo_move'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:658: warning: Function parameter or 
> member 'bdev' not described in 'amdgpu_ttm_io_mem_reserve'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:658: warning: Function parameter or 
> member 'mem' not described in 'amdgpu_ttm_io_mem_reserve'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:751: warning: Function parameter or 
> member 'bo' not described in 'amdgpu_ttm_tt_get_user_pages'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:751: warning: Function parameter or 
> member 'pages' not described in 'amdgpu_ttm_tt_get_user_pages'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:855: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_tt_get_user_pages_done'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:892: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_tt_set_user_pages'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:892: warning: Function parameter or 
> member 'pages' not described in 'amdgpu_ttm_tt_set_user_pages'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:906: warning: Function parameter or 
> member 'bdev' not described in 'amdgpu_ttm_tt_pin_userptr'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:906: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_tt_pin_userptr'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:944: warning: Function parameter or 
> member 'bdev' not described in 'amdgpu_ttm_tt_unpin_userptr'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:944: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_tt_unpin_userptr'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1029: warning: Function parameter or 
> member 'bdev' not described in 'amdgpu_ttm_backend_bind'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1029: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_backend_bind'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1029: warning: Function parameter or 
> member 'bo_mem' not described in 'amdgpu_ttm_backend_bind'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1087: warning: Function parameter or 
> member 'bo' not described in 'amdgpu_ttm_alloc_gart'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1146: warning: Function parameter or 
> member 'tbo' not described in 'amdgpu_ttm_recover_gart'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1168: warning: Function parameter or 
> member 'bdev' not described in 'amdgpu_ttm_backend_unbind'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1168: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_backend_unbind'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1214: warning: Function parameter or 
> member 'page_flags' not described in 'amdgpu_ttm_tt_create'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1247: warning: Function parameter or 
> member 'bdev' not described in 'amdgpu_ttm_tt_populate'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1247: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_tt_populate'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1247: warning: Function parameter or 
> member 'ctx' not described in 'amdgpu_ttm_tt_populate'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1291: warning: Function parameter or 
> member 'bdev' not described in 'amdgpu_ttm_tt_unpopulate'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1291: warning: Function parameter or 
> member 'ttm' not described in 'amdgpu_ttm_tt_unpopulate'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1357: warning

Re: [PATCH] drm: bridge: dw-hdmi: Avoid resetting force in the detect function

2020-11-12 Thread Sam Ravnborg
Hi Jonathan
On Sat, Oct 31, 2020 at 07:17:47PM +1100, Jonathan Liu wrote:
> It has been observed that resetting force in the detect function can
> result in the PHY being powered down in response to hot-plug detect
> being asserted, even when the HDMI connector is forced on.
> 
> Enabling debug messages and adding a call to dump_stack() in
> dw_hdmi_phy_power_off() shows the following in dmesg:
> [  160.637413] dwhdmi-rockchip ff94.hdmi: EVENT=plugin
> [  160.637433] dwhdmi-rockchip ff94.hdmi: PHY powered down in 0 iterations
> 
> Call trace:
> dw_hdmi_phy_power_off
> dw_hdmi_phy_disable
> dw_hdmi_update_power
> dw_hdmi_detect
> dw_hdmi_connector_detect
> drm_helper_probe_detect_ctx
> drm_helper_hpd_irq_event
> dw_hdmi_irq
> irq_thread_fn
> irq_thread
> kthread
> ret_from_fork
> 
> Fixes: 381f05a7a842 ("drm: bridge/dw_hdmi: add connector mode forcing")
> Signed-off-by: Jonathan Liu 

Applied to drm-misc-fixes.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 07/30] drm/amd/amdgpu/amdgpu_fence: Fix some issues pertaining to function documentation

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 2:01 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:139: warning: Function parameter 
> or member 'flags' not described in 'amdgpu_fence_emit'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:197: warning: Function parameter 
> or member 'timeout' not described in 'amdgpu_fence_emit_polling'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:302: warning: Function parameter 
> or member 't' not described in 'amdgpu_fence_fallback'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:302: warning: Excess function 
> parameter 'work' description in 'amdgpu_fence_fallback'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:320: warning: Excess function 
> parameter 'adev' description in 'amdgpu_fence_wait_empty'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:649: warning: Function parameter 
> or member 'f' not described in 'amdgpu_fence_enable_signaling'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:649: warning: Excess function 
> parameter 'fence' description in 'amdgpu_fence_enable_signaling'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:684: warning: Function parameter 
> or member 'f' not described in 'amdgpu_fence_release'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:684: warning: Excess function 
> parameter 'fence' description in 'amdgpu_fence_release'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:749: warning: Function parameter 
> or member 'm' not described in 'amdgpu_debugfs_gpu_recover'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:749: warning: Function parameter 
> or member 'data' not described in 'amdgpu_debugfs_gpu_recover'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Sumit Semwal 
> Cc: Jerome Glisse 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-me...@vger.kernel.org
> Cc: linaro-mm-...@lists.linaro.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index fe2d495d08ab0..d56f4023ebb31 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -130,6 +130,7 @@ static u32 amdgpu_fence_read(struct amdgpu_ring *ring)
>   *
>   * @ring: ring the fence is associated with
>   * @f: resulting fence object
> + * @flags: flags to pass into the subordinate .emit_fence() call
>   *
>   * Emits a fence command on the requested ring (all asics).
>   * Returns 0 on success, -ENOMEM on failure.
> @@ -187,6 +188,7 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct 
> dma_fence **f,
>   *
>   * @ring: ring the fence is associated with
>   * @s: resulting sequence number
> + * @timeout: the timeout for waiting in usecs
>   *
>   * Emits a fence command on the requested ring (all asics).
>   * Used For polling fence.
> @@ -294,7 +296,7 @@ bool amdgpu_fence_process(struct amdgpu_ring *ring)
>  /**
>   * amdgpu_fence_fallback - fallback for hardware interrupts
>   *
> - * @work: delayed work item
> + * @t: timer context used to obtain the pointer to ring structure
>   *
>   * Checks for fence activity.
>   */
> @@ -310,7 +312,6 @@ static void amdgpu_fence_fallback(struct timer_list *t)
>  /**
>   * amdgpu_fence_wait_empty - wait for all fences to signal
>   *
> - * @adev: amdgpu device pointer
>   * @ring: ring index the fence is associated with
>   *
>   * Wait for all fences on the requested ring to signal (all asics).
> @@ -639,7 +640,7 @@ static const char *amdgpu_fence_get_timeline_name(struct 
> dma_fence *f)
>
>  /**
>   * amdgpu_fence_enable_signaling - enable signalling on fence
> - * @fence: fence
> + * @f: fence
>   *
>   * This function is called with fence_queue lock held, and adds a callback
>   * to fence_queue that checks if this fence is signaled, and if so it
> @@ -675,7 +676,7 @@ static void amdgpu_fence_free(struct rcu_head *rcu)
>  /**
>   * amdgpu_fence_release - callback that fence can be freed
>   *
> - * @fence: fence
> + * @f: fence
>   *
>   * This function is called when the reference count becomes zero.
>   * It just RCU schedules freeing up the fence.
> @@ -740,7 +741,7 @@ static int amdgpu_debugfs_fence_info(struct seq_file *m, 
> void *data)
> return 0;
>  }
>
> -/**
> +/*
>   * amdgpu_debugfs_gpu_recover - manually trigger a gpu reset & recover
>   *
>   * Manually trigger a gpu reset at the next fence wait.
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 06/30] drm/amd/amdgpu/amdgpu_kms: Fix misnaming of parameter 'dev'

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 2:01 PM Lee Jones  wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:487: warning: Function parameter or 
> member 'dev' not described in 'amdgpu_info_ioctl'
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:487: warning: Excess function 
> parameter 'adev' description in 'amdgpu_info_ioctl'
>
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: amd-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index cec9aad8bdfa9..98721ae931841 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -474,7 +474,7 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev,
>  /**
>   * amdgpu_info_ioctl - answer a device specific request.
>   *
> - * @adev: amdgpu device pointer
> + * @dev: drm device pointer
>   * @data: request object
>   * @filp: drm filp
>   *
> --
> 2.25.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 1/3] dt-bindings: Convert graph bindings to json-schema

2020-11-12 Thread Rob Herring
On Mon, Nov 2, 2020 at 2:36 PM Rob Herring  wrote:
>
> From: Sameer Pujar 
>
> Convert device tree bindings of graph to YAML format. Currently graph.txt
> doc is referenced in multiple files and all of these need to use schema
> references. For now graph.txt is updated to refer to graph.yaml.
>
> For users of the graph binding, they should reference to the graph
> schema from either 'ports' or 'port' property:
>
> properties:
>   ports:
> type: object
> $ref: graph.yaml#/properties/ports
>
> properties:
>   port@0:
> description: What data this port has
>
>   ...
>
> Or:
>
> properties:
>   port:
> description: What data this port has
> type: object
> $ref: graph.yaml#/properties/port
>
> Signed-off-by: Sameer Pujar 
> Acked-by: Philipp Zabel 
> Signed-off-by: Rob Herring 
> ---
> v3:
>  - Move port 'reg' to port@* and make required
>  - Make remote-endpoint required
>  - Add 'additionalProperties: true' now required
>  - Fix yamllint warnings
>
>  Documentation/devicetree/bindings/graph.txt  | 129 +---
>  Documentation/devicetree/bindings/graph.yaml | 199 +++
>  2 files changed, 200 insertions(+), 128 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/graph.yaml

I've decided to move this to the dt-schema repo instead[1]. I think
that will be easier to manage dependencies (audio-graph.yaml plus
anything else landing this cycle) than subsystems pulling a shared
branch. I haven't merged it yet, so let me know if any
comments/objections. Note that the meta-schema will have to come a bit
later once existing users are updated (which I have patches for).

Rob

[1] https://github.com/devicetree-org/dt-schema/tree/of-graph
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 00/30] Introduce core voltage scaling for NVIDIA Tegra20/30 SoCs

2020-11-12 Thread Thierry Reding
On Thu, Nov 12, 2020 at 10:57:27PM +0300, Dmitry Osipenko wrote:
> 11.11.2020 14:38, Ulf Hansson пишет:
> > On Sun, 8 Nov 2020 at 13:19, Dmitry Osipenko  wrote:
> >>
> >> 05.11.2020 18:22, Dmitry Osipenko пишет:
> >>> 05.11.2020 12:45, Ulf Hansson пишет:
> >>> ...
>  I need some more time to review this, but just a quick check found a
>  few potential issues...
> >>>
> >>> Thank you for starting the review! I'm pretty sure it will take a couple
> >>> revisions until all the questions will be resolved :)
> >>>
>  The "core-supply", that you specify as a regulator for each
>  controller's device node, is not the way we describe power domains.
>  Instead, it seems like you should register a power-domain provider
>  (with the help of genpd) and implement the ->set_performance_state()
>  callback for it. Each device node should then be hooked up to this
>  power-domain, rather than to a "core-supply". For DT bindings, please
>  have a look at Documentation/devicetree/bindings/power/power-domain.yaml
>  and Documentation/devicetree/bindings/power/power_domain.txt.
> 
>  In regards to the "sync state" problem (preventing to change
>  performance states until all consumers have been attached), this can
>  then be managed by the genpd provider driver instead.
> >>>
> >>> I'll need to take a closer look at GENPD, thank you for the suggestion.
> >>>
> >>> Sounds like a software GENPD driver which manages clocks and voltages
> >>> could be a good idea, but it also could be an unnecessary
> >>> over-engineering. Let's see..
> >>>
> >>
> >> Hello Ulf and all,
> >>
> >> I took a detailed look at the GENPD and tried to implement it. Here is
> >> what was found:
> >>
> >> 1. GENPD framework doesn't aggregate performance requests from the
> >> attached devices. This means that if deviceA requests performance state
> >> 10 and then deviceB requests state 3, then framework will set domain's
> >> state to 3 instead of 10.
> >>
> >> https://elixir.bootlin.com/linux/v5.10-rc2/source/drivers/base/power/domain.c#L376
> > 
> > As Viresh also stated, genpd does aggregate the votes. It even
> > performs aggregation hierarchy (a genpd is allowed to have parent(s)
> > to model a topology).
> 
> Yes, I already found and fixed the bug which confused me previously and
> it's working well now.
> 
> >> 2. GENPD framework has a sync() callback in the genpd.domain structure,
> >> but this callback isn't allowed to be used by the GENPD implementation.
> >> The GENPD framework always overrides that callback for its own needs.
> >> Hence GENPD doesn't allow to solve the bootstrapping
> >> state-synchronization problem in a nice way.
> >>
> >> https://elixir.bootlin.com/linux/v5.10-rc2/source/drivers/base/power/domain.c#L2606
> > 
> > That ->sync() callback isn't the callback you are looking for, it's a
> > PM domain specific callback - and has other purposes.
> > 
> > To solve the problem you refer to, your genpd provider driver (a
> > platform driver) should assign its ->sync_state() callback. The
> > ->sync_state() callback will be invoked, when all consumer devices
> > have been attached (and probed) to their corresponding provider.
> > 
> > You may have a look at drivers/cpuidle/cpuidle-psci-domain.c, to see
> > an example of how this works. If there is anything unclear, just tell
> > me and I will try to help.
> 
> Indeed, thank you for the clarification. This variant works well.
> 
> >> 3. Tegra doesn't have a dedicated hardware power-controller for the core
> >> domain, instead there is only an external voltage regulator. Hence we
> >> will need to create a phony device-tree node for the virtual power
> >> domain, which is probably a wrong thing to do.
> > 
> > No, this is absolutely the correct thing to do.
> > 
> > This isn't a virtual power domain, it's a real power domain. You only
> > happen to model the control of it as a regulator, as it fits nicely
> > with that for *this* SoC. Don't get me wrong, that's fine as long as
> > the supply is specified only in the power-domain provider node.
> > 
> > On another SoC, you might have a different FW interface for the power
> > domain provider that doesn't fit well with the regulator. When that
> > happens, all you need to do is to implement a new power domain
> > provider and potentially re-define the power domain topology. More
> > importantly, you don't need to re-invent yet another slew of device
> > specific bindings - for each SoC.
> > 
> >>
> >> ===
> >>
> >> Perhaps it should be possible to create some hacks to work around
> >> bullets 2 and 3 in order to achieve what we need for DVFS on Tegra, but
> >> bullet 1 isn't solvable without changing how the GENPD core works.
> >>
> >> Altogether, the GENPD in its current form is a wrong abstraction for a
> >> system-wide DVFS in a case where multiple devices share power domain and
> >> this domain is a voltage regulator. The regulator framework is the
> >> correct abstraction in this

Re: [PATCH 04/30] drm/via/via_dma: Remove set but unused variable 'agp_base'

2020-11-12 Thread Sam Ravnborg
Hi Lee,
On Thu, Nov 12, 2020 at 07:00:13PM +, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/via/via_dma.c: In function ‘via_cmdbuf_jump’:
>  drivers/gpu/drm/via/via_dma.c:596:11: warning: variable ‘agp_base’ set but 
> not used [-Wunused-but-set-variable]
> 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied to drm-misc-next.
So this is then the final from this set...

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 02/30] include: drm: drm_atomic: Artificially use 'crtc' to avoid 'not used' warning

2020-11-12 Thread Sam Ravnborg
Hi Lee,

On Thu, Nov 12, 2020 at 07:00:11PM +, Lee Jones wrote:
> The precedent has already been set by other macros in the same file.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/vkms/vkms_drv.c:55:19: warning: variable ‘crtc’ set but not 
> used [-Wunused-but-set-variable]
>  55 | struct drm_crtc *crtc;
>  | ^~~~
> 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Thomas Zimmermann 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Rob Clark 
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Also applied to drm-misc-next.
This was the last patch from this batch I will process.
The others are left for the maintainers to pick up.

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 27/30] drm/sti/sti_hdmi: Move 'colorspace_mode_names' array to where its used

2020-11-12 Thread Sam Ravnborg
Hi Lee,
On Thu, Nov 12, 2020 at 07:00:36PM +, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/sti/sti_hdmi.h:36:40: warning: ‘colorspace_mode_names’ 
> defined but not used [-Wunused-const-variable=]
>  36 | static const struct drm_prop_enum_list colorspace_mode_names[] = {
>  | ^
> 
> Cc: Benjamin Gaignard 
> Cc: Vincent Abriou 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Philipp Zabel 
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 

Applied to drm-misc-next,

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] amdgpu/test: deadlock test for CZ family and RV family

2020-11-12 Thread Alex Deucher
On Thu, Nov 12, 2020 at 10:36 AM  wrote:
>
> From: Rajib Mahapatra 
>
> It enables the test for RV2 and PCO, whole GPU reset is not supported
> for others.
>
> Signed-off-by: Rajib Mahapatra 
> Change-Id: Id51605d07b334ecea7a88b3c95fdd57008a4458d

libdrm uses gltlab merge requests.  Please file a gitlab MR for the change:
https://gitlab.freedesktop.org/mesa/drm/-/merge_requests

Alex

> ---
>  include/drm/amdgpu_drm.h  | 15 +++
>  tests/amdgpu/deadlock_tests.c | 18 --
>  2 files changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
> index be84e43c..bb7ded25 100644
> --- a/include/drm/amdgpu_drm.h
> +++ b/include/drm/amdgpu_drm.h
> @@ -995,6 +995,21 @@ struct drm_amdgpu_info_vce_clock_table {
>  #define AMDGPU_FAMILY_AI   141 /* Vega10 */
>  #define AMDGPU_FAMILY_RV   142 /* Raven */
>
> +/*
> + * Asic Rev
> + */
> +#define RAVEN_A0 0x01
> +#define PICASSO_A0 0x41
> +
> +#define RAVEN2_A0 0x81
> +#define RAVEN_UNKNOWN 0xFF
> +
> +#define PICASSO_15D8_REV_E3 0xE3
> +
> +#define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < 
> RAVEN_UNKNOWN)
> +#define ASICREV_IS_PICASSO(eChipRev) ((eChipRev >= PICASSO_A0) && (eChipRev 
> < RAVEN2_A0))
> +#define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < 
> PICASSO_15D8_REV_E3))
> +
>  #if defined(__cplusplus)
>  }
>  #endif
> diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
> index a6c2635d..3be99dc8 100644
> --- a/tests/amdgpu/deadlock_tests.c
> +++ b/tests/amdgpu/deadlock_tests.c
> @@ -126,8 +126,22 @@ CU_BOOL suite_deadlock_tests_enable(void)
> if (device_handle->info.family_id != AMDGPU_FAMILY_VI &&
> device_handle->info.family_id != AMDGPU_FAMILY_AI &&
> device_handle->info.family_id != AMDGPU_FAMILY_CI) {
> -   printf("\n\nGPU reset is not enabled for the ASIC, deadlock 
> suite disabled\n");
> -   enable = CU_FALSE;
> +   if (device_handle->info.family_id == AMDGPU_FAMILY_CZ) {
> +   printf("\n\nWhole GPU reset is not supported for the 
> ASIC, deadlock suite disabled\n");
> +   enable = CU_FALSE;
> +   } else if (device_handle->info.family_id == AMDGPU_FAMILY_RV) 
> {
> +   if 
> (ASICREV_IS_RAVEN2(device_handle->info.chip_external_rev)) {
> +   enable = CU_TRUE;
> +   } else if 
> (ASICREV_IS_PICASSO(device_handle->info.chip_external_rev)) {
> +   enable = CU_TRUE;
> +   } else {
> +   printf("\n\nWhole GPU reset is not supported 
> for the ASIC, deadlock suite disabled\n");
> +   enable = CU_FALSE;
> +   }
> +   } else {
> +   printf("\n\nGPU reset is not enabled for the ASIC, 
> deadlock suite disabled\n");
> +   enable = CU_FALSE;
> +   }
> }
>
> if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)
> --
> 2.17.1
>
> ___
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 01/30] drm/savage/savage_bci: Remove set but never used 'aper_rsrc' and 'fb_rsrc'

2020-11-12 Thread Lee Jones
On Thu, 12 Nov 2020, Sam Ravnborg wrote:

> On Thu, Nov 12, 2020 at 07:00:10PM +, Lee Jones wrote:
> > The comment about them (also removed) says:
> > 
> >  /* fb_rsrc and aper_rsrc aren't really used currently, but still exist
> >   * in case we decide we need information on the BAR for BSD in the
> >   * future.
> >   */
> > 
> > Well that was written 12 years ago in 2008.  We are now in the future
> > and they are still superfluous.  We can always add them again at a
> > later date if they are ever required.
> > 
> > Fixes the following W=1 kernel build warning(s):
> > 
> >  drivers/gpu/drm/savage/savage_bci.c: In function ‘savage_driver_firstopen’:
> >  drivers/gpu/drm/savage/savage_bci.c:580:24: warning: variable ‘aper_rsrc’ 
> > set but not used [-Wunused-but-set-variable]
> >  drivers/gpu/drm/savage/savage_bci.c:580:15: warning: variable ‘fb_rsrc’ 
> > set but not used [-Wunused-but-set-variable]
> > 
> > Cc: David Airlie 
> > Cc: Daniel Vetter 
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Lee Jones 
> > ---
> 
> Thanks, applied to drm-misc-next.

Thanks for your prompt response Sam.  Much appreciated.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 11/30] drm/tegra: dc: Support OPP and SoC core voltage scaling

2020-11-12 Thread Mark Brown
On Thu, Nov 12, 2020 at 10:16:14PM +0300, Dmitry Osipenko wrote:
> 12.11.2020 20:16, Mark Brown пишет:
> > On Thu, Nov 12, 2020 at 07:59:36PM +0300, Dmitry Osipenko wrote:

> >> Also, some device-trees won't have that regulator anyways because board
> >> schematics isn't available, and thus, we can't fix them.

> > This is what dummy supplies are for?

> But it's not allowed to change voltage of a dummy regulator, is it
> intentional?

Of course not, we can't know if the requested new voltage is valid - the
driver would have to have explict support for handling situations where
it's not possible to change the voltage (which it can detect through
enumerating the values it wants to set at startup).

[Requesting the same supply multiple times]
> > So there's no known obstacle to putting enumeration of supported
> > voltages into the OPP core then?  I'm a bit confused here.

> It's an obstacle if both OPP and device driver need to get the same
> regulator. Like in the case of this DRM driver, which need to control
> the voltage instead of allowing OPP core to do it.

It wasn't entirely deliberate but the warnings have proven useful in
catching bugs (eg, leaked regulator requests).  The general thought is
that if two things both claim to control the same supply on a consumer
then they really ought to be coordinating with each other.

> Please notice that devm_tegra_dc_opp_table_init() of this patch doesn't
> use dev_pm_opp_set_regulators(), which would allow OPP core to filter
> out unsupported OPPs. But then OPP core will need need to get an already
> requested regulator and this doesn't work well.

There is nothing stopping us adding a variant of that call which passes
in the regulators that were acquired by the caller rather than having
the OPP core do the requesting, or equally the OPP core could provide a
mechanism for the caller to get the regulators that were requested.

> > Ah, so each board duplicates the OPP tables then, or there's an
> > expectation that if there's some limit then they'll copy and modify the
> > table?  If that's the case then it's a bit redundant to do filtering
> > indeed.

> I think this is not strictly defined. Either way will work, although
> perhaps it should be more preferred that unsupported OPPs aren't present
> in a device-tree.

OTOH that does mean that if there's an updated information on OPPs (new
ones added, old ones determined to be unstable) then you can't just
update a central place.  It depends if the OPPs are thought of as
describing the SoC or the system as a whole I guess.


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 01/30] drm/savage/savage_bci: Remove set but never used 'aper_rsrc' and 'fb_rsrc'

2020-11-12 Thread Sam Ravnborg
On Thu, Nov 12, 2020 at 07:00:10PM +, Lee Jones wrote:
> The comment about them (also removed) says:
> 
>  /* fb_rsrc and aper_rsrc aren't really used currently, but still exist
>   * in case we decide we need information on the BAR for BSD in the
>   * future.
>   */
> 
> Well that was written 12 years ago in 2008.  We are now in the future
> and they are still superfluous.  We can always add them again at a
> later date if they are ever required.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/savage/savage_bci.c: In function ‘savage_driver_firstopen’:
>  drivers/gpu/drm/savage/savage_bci.c:580:24: warning: variable ‘aper_rsrc’ 
> set but not used [-Wunused-but-set-variable]
>  drivers/gpu/drm/savage/savage_bci.c:580:15: warning: variable ‘fb_rsrc’ set 
> but not used [-Wunused-but-set-variable]
> 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones 
> ---

Thanks, applied to drm-misc-next.

Sam

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 13/30] drm/atmel-hlcdc/atmel_hlcdc_crtc: Apply correct formatting to struct docs

2020-11-12 Thread Sam Ravnborg
On Thu, Nov 12, 2020 at 07:00:22PM +, Lee Jones wrote:
> And fix-up a misnamed member description.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c:33: warning: cannot 
> understand function prototype: 'struct atmel_hlcdc_crtc_state '
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c:52: warning: cannot 
> understand function prototype: 'struct atmel_hlcdc_crtc '
> 
> Cc: Sam Ravnborg 
> Cc: Boris Brezillon 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Nicolas Ferre 
> Cc: Alexandre Belloni 
> Cc: Ludovic Desroches 
> Cc: Jean-Jacques Hiblot 
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-arm-ker...@lists.infradead.org
> Signed-off-by: Lee Jones 

Thanks, applied to drm-misc-next.

Sam

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 17/30] drm/atmel-hlcdc/atmel_hlcdc_plane: Fix documentation formatting and add missing description

2020-11-12 Thread Sam Ravnborg
On Thu, Nov 12, 2020 at 07:00:26PM +, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c:283:6: warning: no previous 
> prototype for ‘atmel_hlcdc_plane_setup_scaler’ [-Wmissing-prototypes]
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c:44: warning: cannot 
> understand function prototype: 'struct atmel_hlcdc_plane_state '
> 
> Cc: Sam Ravnborg 
> Cc: Boris Brezillon 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Nicolas Ferre 
> Cc: Alexandre Belloni 
> Cc: Ludovic Desroches 
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-arm-ker...@lists.infradead.org
> Signed-off-by: Lee Jones 

Thanks, applied to drm-misc-next.

Sam

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 16/30] drm/atmel-hlcdc/atmel_hlcdc_plane: Staticise local function 'atmel_hlcdc_plane_setup_scaler()'

2020-11-12 Thread Sam Ravnborg
On Thu, Nov 12, 2020 at 07:00:25PM +, Lee Jones wrote:
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c:283:6: warning: no previous 
> prototype for ‘atmel_hlcdc_plane_setup_scaler’ [-Wmissing-prototypes]
> 
> Cc: Sam Ravnborg 
> Cc: Boris Brezillon 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: Nicolas Ferre 
> Cc: Alexandre Belloni 
> Cc: Ludovic Desroches 
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-arm-ker...@lists.infradead.org
> Signed-off-by: Lee Jones 

Thanks, applied to drm-misc-next.

Sam

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 19/30] drm/amd/amdgpu/amdgpu_cs: Add a couple of missing function param descriptions

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:685: warning: Function parameter or 
member 'backoff' not described in 'amdgpu_cs_parser_fini'
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1655: warning: Function parameter or 
member 'map' not described in 'amdgpu_cs_find_mapping'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: Jerome Glisse 
Cc: amd-...@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 8d2878e950dab..594a0108e90fa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -676,6 +676,7 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser *p)
  * cs_parser_fini() - clean parser states
  * @parser:parser structure holding parsing context.
  * @error: error number
+ * @backoff:   indicator to backoff the reservation
  *
  * If error is set than unvalidate buffer, otherwise just free memory
  * used by parsing context.
@@ -1644,6 +1645,7 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, 
void *data,
  * @parser: command submission parser context
  * @addr: VM address
  * @bo: resulting BO of the mapping found
+ * @map: Placeholder to return found BO mapping
  *
  * Search the buffer objects in the command submission context for a certain
  * virtual memory address. Returns allocation structure when found, NULL
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 20/30] drm/armada/armada_overlay: Staticify local function 'armada_overlay_duplicate_state'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/armada/armada_overlay.c:329:1: warning: no previous prototype 
for ‘armada_overlay_duplicate_state’ [-Wmissing-prototypes]

Cc: Russell King 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/armada/armada_overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_overlay.c 
b/drivers/gpu/drm/armada/armada_overlay.c
index 30e01101f59ed..6346b890279a0 100644
--- a/drivers/gpu/drm/armada/armada_overlay.c
+++ b/drivers/gpu/drm/armada/armada_overlay.c
@@ -325,7 +325,7 @@ static void armada_overlay_reset(struct drm_plane *plane)
}
 }
 
-struct drm_plane_state *
+static struct drm_plane_state *
 armada_overlay_duplicate_state(struct drm_plane *plane)
 {
struct armada_overlay_state *state;
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 22/30] drm/rockchip/dw-mipi-dsi-rockchip: Demote non-conformant kernel-doc headers

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:357: warning: Function 
parameter or member 'dsi' not described in 'ns2bc'
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:357: warning: Function 
parameter or member 'ns' not described in 'ns2bc'
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:365: warning: Function 
parameter or member 'dsi' not described in 'ns2ui'
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c:365: warning: Function 
parameter or member 'ns' not described in 'ns2ui'

Cc: Sandy Huang 
Cc: "Heiko Stübner" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Chris Zhong 
Cc: Nickey Yang 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-rockc...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 542dcf7eddd66..e84325e56d980 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -350,7 +350,7 @@ static void dw_mipi_dsi_phy_write(struct 
dw_mipi_dsi_rockchip *dsi,
dsi_write(dsi, DSI_PHY_TST_CTRL0, PHY_TESTCLK | PHY_UNTESTCLR);
 }
 
-/**
+/*
  * ns2bc - Nanoseconds to byte clock cycles
  */
 static inline unsigned int ns2bc(struct dw_mipi_dsi_rockchip *dsi, int ns)
@@ -358,7 +358,7 @@ static inline unsigned int ns2bc(struct 
dw_mipi_dsi_rockchip *dsi, int ns)
return DIV_ROUND_UP(ns * dsi->lane_mbps / 8, 1000);
 }
 
-/**
+/*
  * ns2ui - Nanoseconds to UI time periods
  */
 static inline unsigned int ns2ui(struct dw_mipi_dsi_rockchip *dsi, int ns)
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 18/30] drm/vc4/vc4_v3d: Demote non-conformant kernel-doc headers

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/vc4/vc4_v3d.c:131: warning: Function parameter or member 'vc4' 
not described in 'vc4_v3d_pm_get'
 drivers/gpu/drm/vc4/vc4_v3d.c:231: warning: Function parameter or member 'vc4' 
not described in 'bin_bo_alloc'

Cc: Eric Anholt 
Cc: Maxime Ripard 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Rob Clark 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/vc4/vc4_v3d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index 65d0dac69b0bc..73d63d72575b0 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -122,7 +122,7 @@ static int vc4_v3d_debugfs_ident(struct seq_file *m, void 
*unused)
return 0;
 }
 
-/**
+/*
  * Wraps pm_runtime_get_sync() in a refcount, so that we can reliably
  * get the pm_runtime refcount to 0 in vc4_reset().
  */
@@ -205,7 +205,7 @@ int vc4_v3d_get_bin_slot(struct vc4_dev *vc4)
return -ENOMEM;
 }
 
-/**
+/*
  * bin_bo_alloc() - allocates the memory that will be used for
  * tile binning.
  *
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 08/30] drm/exynos/exynos7_drm_decon: Supply missing description for param 'ctx'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/exynos/exynos7_drm_decon.c:354: warning: Function parameter or 
member 'ctx' not described in 'decon_shadow_protect_win'

Cc: Inki Dae 
Cc: Joonyoung Shim 
Cc: Seung-Woo Kim 
Cc: Kyungmin Park 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Krzysztof Kozlowski 
Cc: Akshu Agarwal 
Cc: Ajay Kumar 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/exynos/exynos7_drm_decon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index f2d87a7445c73..431c5d32f9a47 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -346,6 +346,7 @@ static void decon_win_set_colkey(struct decon_context *ctx, 
unsigned int win)
 /**
  * shadow_protect_win() - disable updating values from shadow registers at 
vsync
  *
+ * @ctx: display and enhancement controller context
  * @win: window to protect registers for
  * @protect: 1 to protect (disable updates)
  */
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 00/30] [Set 6] Rid W=1 warnings from GPU

2020-11-12 Thread Lee Jones
This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

NB: Hopefully the other sets turn up in -next soon, so they can
be rebased and any stragglers re-submitted.

Lee Jones (30):
  drm/savage/savage_bci: Remove set but never used 'aper_rsrc' and
'fb_rsrc'
  include: drm: drm_atomic: Artificially use 'crtc' to avoid 'not used'
warning
  drm/v3d/v3d_gem: Provide descriptions for 'v3d_lookup_bos's params
  drm/via/via_dma: Remove set but unused variable 'agp_base'
  drm/v3d/v3d_sched: Demote non-conformant kernel-doc header
  drm/amd/amdgpu/amdgpu_kms: Fix misnaming of parameter 'dev'
  drm/amd/amdgpu/amdgpu_fence: Fix some issues pertaining to function
documentation
  drm/exynos/exynos7_drm_decon: Supply missing description for  param
'ctx'
  drm/exynos/exynos_drm_fimd: Add missing description for param 'ctx'
  drm/vc4/vc4_hdmi_regs: Mark some data sets as __maybe_unused
  drm/vc4/vc4_hdmi: Remove set but unused variable 'ret'
  drm/amd/amdgpu/amdgpu_ttm: Demote non-conformant kernel-doc headers,
fix slightly lacking ones
  drm/atmel-hlcdc/atmel_hlcdc_crtc: Apply correct formatting to struct
docs
  drm/amd/amdgpu/amdgpu_ring: Fix a bunch of function misdocumentation
  drm/amd/amdgpu/amdgpu_display: Remove pointless header
  drm/atmel-hlcdc/atmel_hlcdc_plane: Staticise local function
'atmel_hlcdc_plane_setup_scaler()'
  drm/atmel-hlcdc/atmel_hlcdc_plane: Fix documentation formatting and
add missing description
  drm/vc4/vc4_v3d: Demote non-conformant kernel-doc headers
  drm/amd/amdgpu/amdgpu_cs: Add a couple of missing function param
descriptions
  drm/armada/armada_overlay: Staticify local function
'armada_overlay_duplicate_state'
  drm/vc4/vc4_debugfs: Demote non-conformant kernel-doc headers
  drm/rockchip/dw-mipi-dsi-rockchip: Demote non-conformant kernel-doc
headers
  drm/rockchip/rockchip_rgb: Consume our own header
  drm/nouveau/nvkm/core/firmware: Fix formatting, provide missing param
description
  drm/rockchip/rockchip_lvds: Fix struct document formatting
  drm/exynos/exynos_drm_gsc: Supply missing description for 'num_limits'
  drm/sti/sti_hdmi: Move 'colorspace_mode_names' array to where its used
  drm/mediatek/mtk_disp_color: Fix formatting and provide missing member
description
  drm/amd/amdgpu/atombios_encoders: Remove set but unused variable
'backlight_level'
  drm/mediatek/mtk_disp_ovl: Fix formatting and provide missing member
description

 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c|  2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  4 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 11 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c  | 12 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c   | 60 ++-
 .../gpu/drm/amd/amdgpu/atombios_encoders.c|  3 +-
 drivers/gpu/drm/armada/armada_overlay.c   |  2 +-
 .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c|  6 +-
 .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c   |  7 ++-
 drivers/gpu/drm/exynos/exynos7_drm_decon.c|  1 +
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  |  1 +
 drivers/gpu/drm/exynos/exynos_drm_gsc.c   |  1 +
 drivers/gpu/drm/mediatek/mtk_disp_color.c |  5 +-
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c   |  5 +-
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c  |  9 +--
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   |  4 +-
 drivers/gpu/drm/rockchip/rockchip_lvds.c  |  2 +-
 drivers/gpu/drm/rockchip/rockchip_rgb.c   |  1 +
 drivers/gpu/drm/savage/savage_bci.c   | 11 
 drivers/gpu/drm/sti/sti_hdmi.c|  6 ++
 drivers/gpu/drm/sti/sti_hdmi.h|  6 --
 drivers/gpu/drm/v3d/v3d_gem.c |  2 +
 drivers/gpu/drm/v3d/v3d_sched.c   |  2 +-
 drivers/gpu/drm/vc4/vc4_debugfs.c |  4 +-
 drivers/gpu/drm/vc4/vc4_hdmi.c|  3 +-
 drivers/gpu/drm/vc4/vc4_hdmi_regs.h   |  6 +-
 drivers/gpu/drm/vc4/vc4_v3d.c |  4 +-
 drivers/gpu/drm/via/via_dma.c |  2 -
 include/drm/drm_atomic.h  |  1 +
 30 files changed, 91 insertions(+), 94 deletions(-)

Cc: Ajay Kumar 
Cc: Akshu Agarwal 
Cc: Alexandre Belloni 
Cc: Alex Deucher 
Cc: amd-...@lists.freedesktop.org
Cc: Benjamin Gaignard 
Cc: Ben Skeggs 
Cc: Boris Brezillon 
Cc: "Christian König" 
Cc: Chris Zhong 
Cc: Chun-Kuang Hu 
Cc: Daniel Vetter 
Cc: David Airlie 
Cc: dri-devel@lists.freedesktop.org
Cc: Eric Anholt 
Cc: Eunchul Kim 
Cc: "Heiko Stübner" 
Cc: Inki Dae 
Cc: Jean-Jacques Hiblot 
Cc: Jerome Glisse 
Cc: Jinyoung Jeon 
Cc: Joonyoung Shim 
Cc: Krzysztof Kozlowski 
Cc: Kyungmin Park 
Cc: linaro-mm-...@lists.linaro.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-media...@lists.infradead.org
Cc: linux-me...@vger.kernel.org
Cc: linux-rockc...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
Cc

[PATCH 27/30] drm/sti/sti_hdmi: Move 'colorspace_mode_names' array to where its used

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/sti/sti_hdmi.h:36:40: warning: ‘colorspace_mode_names’ defined 
but not used [-Wunused-const-variable=]
 36 | static const struct drm_prop_enum_list colorspace_mode_names[] = {
 | ^

Cc: Benjamin Gaignard 
Cc: Vincent Abriou 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Philipp Zabel 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/sti/sti_hdmi.c | 6 ++
 drivers/gpu/drm/sti/sti_hdmi.h | 6 --
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 38a558768e531..f3ace11209dd7 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -167,6 +167,12 @@ struct sti_hdmi_connector {
 #define to_sti_hdmi_connector(x) \
container_of(x, struct sti_hdmi_connector, drm_connector)
 
+static const struct drm_prop_enum_list colorspace_mode_names[] = {
+   { HDMI_COLORSPACE_RGB, "rgb" },
+   { HDMI_COLORSPACE_YUV422, "yuv422" },
+   { HDMI_COLORSPACE_YUV444, "yuv444" },
+};
+
 u32 hdmi_read(struct sti_hdmi *hdmi, int offset)
 {
return readl(hdmi->regs + offset);
diff --git a/drivers/gpu/drm/sti/sti_hdmi.h b/drivers/gpu/drm/sti/sti_hdmi.h
index 1f6dc90b5d83a..05b2f3d0d48d3 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.h
+++ b/drivers/gpu/drm/sti/sti_hdmi.h
@@ -33,12 +33,6 @@ struct hdmi_audio_params {
struct hdmi_audio_infoframe cea;
 };
 
-static const struct drm_prop_enum_list colorspace_mode_names[] = {
-   { HDMI_COLORSPACE_RGB, "rgb" },
-   { HDMI_COLORSPACE_YUV422, "yuv422" },
-   { HDMI_COLORSPACE_YUV444, "yuv444" },
-};
-
 #define DEFAULT_COLORSPACE_MODE HDMI_COLORSPACE_RGB
 
 /**
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 11/30] drm/vc4/vc4_hdmi: Remove set but unused variable 'ret'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/vc4/vc4_hdmi.c: In function ‘vc4_hdmi_set_audio_infoframe’:
 drivers/gpu/drm/vc4/vc4_hdmi.c:334:6: warning: variable ‘ret’ set but not used 
[-Wunused-but-set-variable]

Cc: Eric Anholt 
Cc: Maxime Ripard 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Philipp Zabel 
Cc: Rob Clark 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 95779d50cca0b..b80eb9d3d9d5a 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -331,9 +331,8 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder 
*encoder)
 {
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
union hdmi_infoframe frame;
-   int ret;
 
-   ret = hdmi_audio_infoframe_init(&frame.audio);
+   hdmi_audio_infoframe_init(&frame.audio);
 
frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM;
frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM;
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 01/30] drm/savage/savage_bci: Remove set but never used 'aper_rsrc' and 'fb_rsrc'

2020-11-12 Thread Lee Jones
The comment about them (also removed) says:

 /* fb_rsrc and aper_rsrc aren't really used currently, but still exist
  * in case we decide we need information on the BAR for BSD in the
  * future.
  */

Well that was written 12 years ago in 2008.  We are now in the future
and they are still superfluous.  We can always add them again at a
later date if they are ever required.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/savage/savage_bci.c: In function ‘savage_driver_firstopen’:
 drivers/gpu/drm/savage/savage_bci.c:580:24: warning: variable ‘aper_rsrc’ set 
but not used [-Wunused-but-set-variable]
 drivers/gpu/drm/savage/savage_bci.c:580:15: warning: variable ‘fb_rsrc’ set 
but not used [-Wunused-but-set-variable]

Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/savage/savage_bci.c | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/savage/savage_bci.c 
b/drivers/gpu/drm/savage/savage_bci.c
index 6889d6534ebab..606e5b807a6e7 100644
--- a/drivers/gpu/drm/savage/savage_bci.c
+++ b/drivers/gpu/drm/savage/savage_bci.c
@@ -573,19 +573,12 @@ int savage_driver_firstopen(struct drm_device *dev)
 {
drm_savage_private_t *dev_priv = dev->dev_private;
unsigned long mmio_base, fb_base, fb_size, aperture_base;
-   /* fb_rsrc and aper_rsrc aren't really used currently, but still exist
-* in case we decide we need information on the BAR for BSD in the
-* future.
-*/
-   unsigned int fb_rsrc, aper_rsrc;
int ret = 0;
 
if (S3_SAVAGE3D_SERIES(dev_priv->chipset)) {
-   fb_rsrc = 0;
fb_base = pci_resource_start(dev->pdev, 0);
fb_size = SAVAGE_FB_SIZE_S3;
mmio_base = fb_base + SAVAGE_FB_SIZE_S3;
-   aper_rsrc = 0;
aperture_base = fb_base + SAVAGE_APERTURE_OFFSET;
/* this should always be true */
if (pci_resource_len(dev->pdev, 0) == 0x0800) {
@@ -607,10 +600,8 @@ int savage_driver_firstopen(struct drm_device *dev)
} else if (dev_priv->chipset != S3_SUPERSAVAGE &&
   dev_priv->chipset != S3_SAVAGE2000) {
mmio_base = pci_resource_start(dev->pdev, 0);
-   fb_rsrc = 1;
fb_base = pci_resource_start(dev->pdev, 1);
fb_size = SAVAGE_FB_SIZE_S4;
-   aper_rsrc = 1;
aperture_base = fb_base + SAVAGE_APERTURE_OFFSET;
/* this should always be true */
if (pci_resource_len(dev->pdev, 1) == 0x0800) {
@@ -626,10 +617,8 @@ int savage_driver_firstopen(struct drm_device *dev)
}
} else {
mmio_base = pci_resource_start(dev->pdev, 0);
-   fb_rsrc = 1;
fb_base = pci_resource_start(dev->pdev, 1);
fb_size = pci_resource_len(dev->pdev, 1);
-   aper_rsrc = 2;
aperture_base = pci_resource_start(dev->pdev, 2);
/* Automatic MTRR setup will do the right thing. */
}
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 05/30] drm/v3d/v3d_sched: Demote non-conformant kernel-doc header

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/v3d/v3d_sched.c:75: warning: Function parameter or member 
'sched_job' not described in 'v3d_job_dependency'
 drivers/gpu/drm/v3d/v3d_sched.c:75: warning: Function parameter or member 
's_entity' not described in 'v3d_job_dependency'

Cc: Eric Anholt 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: "Christian König" 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/v3d/v3d_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c
index 0747614a78f0b..452682e2209f4 100644
--- a/drivers/gpu/drm/v3d/v3d_sched.c
+++ b/drivers/gpu/drm/v3d/v3d_sched.c
@@ -63,7 +63,7 @@ v3d_job_free(struct drm_sched_job *sched_job)
v3d_job_put(job);
 }
 
-/**
+/*
  * Returns the fences that the job depends on, one by one.
  *
  * If placed in the scheduler's .dependency method, the corresponding
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 17/30] drm/atmel-hlcdc/atmel_hlcdc_plane: Fix documentation formatting and add missing description

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c:283:6: warning: no previous 
prototype for ‘atmel_hlcdc_plane_setup_scaler’ [-Wmissing-prototypes]
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c:44: warning: cannot understand 
function prototype: 'struct atmel_hlcdc_plane_state '

Cc: Sam Ravnborg 
Cc: Boris Brezillon 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Nicolas Ferre 
Cc: Alexandre Belloni 
Cc: Ludovic Desroches 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 2d502d23ab12d..15bc93163833b 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -19,7 +19,7 @@
 #include "atmel_hlcdc_dc.h"
 
 /**
- * Atmel HLCDC Plane state structure.
+ * struct atmel_hlcdc_plane_state - Atmel HLCDC Plane state structure.
  *
  * @base: DRM plane state
  * @crtc_x: x position of the plane relative to the CRTC
@@ -34,6 +34,7 @@
  * @disc_y: y discard position
  * @disc_w: discard width
  * @disc_h: discard height
+ * @ahb_id: AHB identification number
  * @bpp: bytes per pixel deduced from pixel_format
  * @offsets: offsets to apply to the GEM buffers
  * @xstride: value to add to the pixel pointer between each line
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 23/30] drm/rockchip/rockchip_rgb: Consume our own header

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/rockchip/rockchip_rgb.c:71:22: warning: no previous prototype 
for ‘rockchip_rgb_init’ [-Wmissing-prototypes]
 drivers/gpu/drm/rockchip/rockchip_rgb.c:159:6: warning: no previous prototype 
for ‘rockchip_rgb_fini’ [-Wmissing-prototypes]

Cc: Sandy Huang 
Cc: "Heiko Stübner" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-rockc...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c 
b/drivers/gpu/drm/rockchip/rockchip_rgb.c
index 9a771af5d0c95..c079714477d8a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_rgb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c
@@ -18,6 +18,7 @@
 
 #include "rockchip_drm_drv.h"
 #include "rockchip_drm_vop.h"
+#include "rockchip_rgb.h"
 
 #define encoder_to_rgb(c) container_of(c, struct rockchip_rgb, encoder)
 
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 16/30] drm/atmel-hlcdc/atmel_hlcdc_plane: Staticise local function 'atmel_hlcdc_plane_setup_scaler()'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c:283:6: warning: no previous 
prototype for ‘atmel_hlcdc_plane_setup_scaler’ [-Wmissing-prototypes]

Cc: Sam Ravnborg 
Cc: Boris Brezillon 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Nicolas Ferre 
Cc: Alexandre Belloni 
Cc: Ludovic Desroches 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 40800ec5700a8..2d502d23ab12d 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -280,8 +280,8 @@ atmel_hlcdc_plane_scaler_set_phicoeff(struct 
atmel_hlcdc_plane *plane,
coeff_tab[i]);
 }
 
-void atmel_hlcdc_plane_setup_scaler(struct atmel_hlcdc_plane *plane,
-   struct atmel_hlcdc_plane_state *state)
+static void atmel_hlcdc_plane_setup_scaler(struct atmel_hlcdc_plane *plane,
+  struct atmel_hlcdc_plane_state 
*state)
 {
const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc;
u32 xfactor, yfactor;
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 12/30] drm/amd/amdgpu/amdgpu_ttm: Demote non-conformant kernel-doc headers, fix slightly lacking ones

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
member 'bo' not described in 'amdgpu_move_blit'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
member 'evict' not described in 'amdgpu_move_blit'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
member 'new_mem' not described in 'amdgpu_move_blit'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:464: warning: Function parameter or 
member 'old_mem' not described in 'amdgpu_move_blit'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:522: warning: Function parameter or 
member 'adev' not described in 'amdgpu_mem_visible'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:522: warning: Function parameter or 
member 'mem' not described in 'amdgpu_mem_visible'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
member 'bo' not described in 'amdgpu_bo_move'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
member 'evict' not described in 'amdgpu_bo_move'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
member 'ctx' not described in 'amdgpu_bo_move'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
member 'new_mem' not described in 'amdgpu_bo_move'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:548: warning: Function parameter or 
member 'hop' not described in 'amdgpu_bo_move'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:658: warning: Function parameter or 
member 'bdev' not described in 'amdgpu_ttm_io_mem_reserve'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:658: warning: Function parameter or 
member 'mem' not described in 'amdgpu_ttm_io_mem_reserve'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:751: warning: Function parameter or 
member 'bo' not described in 'amdgpu_ttm_tt_get_user_pages'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:751: warning: Function parameter or 
member 'pages' not described in 'amdgpu_ttm_tt_get_user_pages'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:855: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_tt_get_user_pages_done'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:892: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_tt_set_user_pages'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:892: warning: Function parameter or 
member 'pages' not described in 'amdgpu_ttm_tt_set_user_pages'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:906: warning: Function parameter or 
member 'bdev' not described in 'amdgpu_ttm_tt_pin_userptr'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:906: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_tt_pin_userptr'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:944: warning: Function parameter or 
member 'bdev' not described in 'amdgpu_ttm_tt_unpin_userptr'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:944: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_tt_unpin_userptr'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1029: warning: Function parameter or 
member 'bdev' not described in 'amdgpu_ttm_backend_bind'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1029: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_backend_bind'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1029: warning: Function parameter or 
member 'bo_mem' not described in 'amdgpu_ttm_backend_bind'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1087: warning: Function parameter or 
member 'bo' not described in 'amdgpu_ttm_alloc_gart'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1146: warning: Function parameter or 
member 'tbo' not described in 'amdgpu_ttm_recover_gart'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1168: warning: Function parameter or 
member 'bdev' not described in 'amdgpu_ttm_backend_unbind'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1168: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_backend_unbind'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1214: warning: Function parameter or 
member 'page_flags' not described in 'amdgpu_ttm_tt_create'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1247: warning: Function parameter or 
member 'bdev' not described in 'amdgpu_ttm_tt_populate'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1247: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_tt_populate'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1247: warning: Function parameter or 
member 'ctx' not described in 'amdgpu_ttm_tt_populate'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1291: warning: Function parameter or 
member 'bdev' not described in 'amdgpu_ttm_tt_unpopulate'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1291: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_tt_unpopulate'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1357: warning: Function parameter or 
member 'ttm' not described in 'amdgpu_ttm_tt_get_usermm'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1376: warning: Function parameter or 
member 'ttm' not described in 'amdgp

[PATCH 09/30] drm/exynos/exynos_drm_fimd: Add missing description for param 'ctx'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/exynos/exynos_drm_fimd.c:733: warning: Function parameter or 
member 'ctx' not described in 'fimd_shadow_protect_win'

Cc: Inki Dae 
Cc: Joonyoung Shim 
Cc: Seung-Woo Kim 
Cc: Kyungmin Park 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Krzysztof Kozlowski 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bb67cad8371f0..49a2e0c539187 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -725,6 +725,7 @@ static void fimd_win_set_colkey(struct fimd_context *ctx, 
unsigned int win)
 /**
  * shadow_protect_win() - disable updating values from shadow registers at 
vsync
  *
+ * @ctx: local driver data
  * @win: window to protect registers for
  * @protect: 1 to protect (disable updates)
  */
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 15/30] drm/amd/amdgpu/amdgpu_display: Remove pointless header

2020-11-12 Thread Lee Jones
It seems only to repeat the function name.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:450: warning: Function parameter 
or member 'amdgpu_connector' not described in 'amdgpu_display_ddc_probe'
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:450: warning: Function parameter 
or member 'use_aux' not described in 'amdgpu_display_ddc_probe'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: report to 
Cc: amd-...@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 0b134598b3a65..f4de4b41adcfd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -441,10 +441,6 @@ void amdgpu_display_print_display_setup(struct drm_device 
*dev)
drm_connector_list_iter_end(&iter);
 }
 
-/**
- * amdgpu_display_ddc_probe
- *
- */
 bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
  bool use_aux)
 {
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 21/30] drm/vc4/vc4_debugfs: Demote non-conformant kernel-doc headers

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/vc4/vc4_debugfs.c:25: warning: Function parameter or member 
'minor' not described in 'vc4_debugfs_init'
 drivers/gpu/drm/vc4/vc4_debugfs.c:62: warning: Function parameter or member 
'dev' not described in 'vc4_debugfs_add_file'
 drivers/gpu/drm/vc4/vc4_debugfs.c:62: warning: Function parameter or member 
'name' not described in 'vc4_debugfs_add_file'
 drivers/gpu/drm/vc4/vc4_debugfs.c:62: warning: Function parameter or member 
'show' not described in 'vc4_debugfs_add_file'
 drivers/gpu/drm/vc4/vc4_debugfs.c:62: warning: Function parameter or member 
'data' not described in 'vc4_debugfs_add_file'

Cc: Eric Anholt 
Cc: Maxime Ripard 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/vc4/vc4_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c 
b/drivers/gpu/drm/vc4/vc4_debugfs.c
index 4fbbf980a299f..6da22af4ee911 100644
--- a/drivers/gpu/drm/vc4/vc4_debugfs.c
+++ b/drivers/gpu/drm/vc4/vc4_debugfs.c
@@ -16,7 +16,7 @@ struct vc4_debugfs_info_entry {
struct drm_info_list info;
 };
 
-/**
+/*
  * Called at drm_dev_register() time on each of the minors registered
  * by the DRM device, to attach the debugfs files.
  */
@@ -46,7 +46,7 @@ static int vc4_debugfs_regset32(struct seq_file *m, void 
*unused)
return 0;
 }
 
-/**
+/*
  * Registers a debugfs file with a callback function for a vc4 component.
  *
  * This is like drm_debugfs_create_files(), but that can only be
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 25/30] drm/rockchip/rockchip_lvds: Fix struct document formatting

2020-11-12 Thread Lee Jones
Must start with "struct "

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/rockchip/rockchip_lvds.c:49: warning: cannot understand 
function prototype: 'struct rockchip_lvds_soc_data '

Cc: Sandy Huang 
Cc: "Heiko Stübner" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Mark Yao 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-rockc...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/rockchip/rockchip_lvds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c 
b/drivers/gpu/drm/rockchip/rockchip_lvds.c
index f292c6a6e20fb..8658ef82d937b 100644
--- a/drivers/gpu/drm/rockchip/rockchip_lvds.c
+++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c
@@ -42,7 +42,7 @@ struct rockchip_lvds;
container_of(c, struct rockchip_lvds, encoder)
 
 /**
- * rockchip_lvds_soc_data - rockchip lvds Soc private data
+ * struct rockchip_lvds_soc_data - rockchip lvds Soc private data
  * @probe: LVDS platform probe function
  * @helper_funcs: LVDS connector helper functions
  */
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 03/30] drm/v3d/v3d_gem: Provide descriptions for 'v3d_lookup_bos's params

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/v3d/v3d_gem.c:292: warning: Function parameter or member 
'bo_handles' not described in 'v3d_lookup_bos'
 drivers/gpu/drm/v3d/v3d_gem.c:292: warning: Function parameter or member 
'bo_count' not described in 'v3d_lookup_bos'

Cc: Eric Anholt 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Philipp Zabel 
Cc: Sumit Semwal 
Cc: "Christian König" 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/v3d/v3d_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index 182c586525eb8..4eb3542269725 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -275,6 +275,8 @@ v3d_lock_bo_reservations(struct v3d_job *job,
  * @dev: DRM device
  * @file_priv: DRM file for this fd
  * @job: V3D job being set up
+ * @bo_handles: GEM handles
+ * @bo_count: Number of GEM handles passed in
  *
  * The command validator needs to reference BOs by their index within
  * the submitted job's BO list.  This does the validation of the job's
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 26/30] drm/exynos/exynos_drm_gsc: Supply missing description for 'num_limits'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/exynos/exynos_drm_gsc.c:129: warning: Function parameter or 
member 'num_limits' not described in 'gsc_driverdata'

Cc: Inki Dae 
Cc: Joonyoung Shim 
Cc: Seung-Woo Kim 
Cc: Kyungmin Park 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Krzysztof Kozlowski 
Cc: Eunchul Kim 
Cc: Jinyoung Jeon 
Cc: Sangmin Lee 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-samsung-...@vger.kernel.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/exynos/exynos_drm_gsc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c 
b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index 45e9aee8366a8..b01f36e76eafd 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -118,6 +118,7 @@ struct gsc_context {
  * struct gsc_driverdata - per device type driver data for init time.
  *
  * @limits: picture size limits array
+ * @num_limits: number of items in the aforementioned array
  * @clk_names: names of clocks needed by this variant
  * @num_clocks: the number of clocks needed by this variant
  */
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 28/30] drm/mediatek/mtk_disp_color: Fix formatting and provide missing member description

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/mediatek/mtk_disp_color.c:40: warning: Function parameter or 
member 'ddp_comp' not described in 'mtk_disp_color'
 drivers/gpu/drm/mediatek/mtk_disp_color.c:40: warning: Function parameter or 
member 'crtc' not described in 'mtk_disp_color'
 drivers/gpu/drm/mediatek/mtk_disp_color.c:40: warning: Function parameter or 
member 'data' not described in 'mtk_disp_color'

Cc: Chun-Kuang Hu 
Cc: Philipp Zabel 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Matthias Brugger 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-media...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/mediatek/mtk_disp_color.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c 
b/drivers/gpu/drm/mediatek/mtk_disp_color.c
index 3ae9c810845bb..a788ff95ed6e4 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_color.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c
@@ -30,8 +30,9 @@ struct mtk_disp_color_data {
 
 /**
  * struct mtk_disp_color - DISP_COLOR driver structure
- * @ddp_comp - structure containing type enum and hardware resources
- * @crtc - associated crtc to report irq events to
+ * @ddp_comp: structure containing type enum and hardware resources
+ * @crtc: associated crtc to report irq events to
+ * @data: platform colour driver data
  */
 struct mtk_disp_color {
struct mtk_ddp_comp ddp_comp;
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 30/30] drm/mediatek/mtk_disp_ovl: Fix formatting and provide missing member description

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/mediatek/mtk_disp_ovl.c:75: warning: Function parameter or 
member 'ddp_comp' not described in 'mtk_disp_ovl'
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c:75: warning: Function parameter or 
member 'crtc' not described in 'mtk_disp_ovl'
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c:75: warning: Function parameter or 
member 'data' not described in 'mtk_disp_ovl'

Cc: Chun-Kuang Hu 
Cc: Philipp Zabel 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Matthias Brugger 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-media...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c 
b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index 28651bc579bc9..74ef6fc0528b6 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -65,8 +65,9 @@ struct mtk_disp_ovl_data {
 
 /**
  * struct mtk_disp_ovl - DISP_OVL driver structure
- * @ddp_comp - structure containing type enum and hardware resources
- * @crtc - associated crtc to report vblank events to
+ * @ddp_comp: structure containing type enum and hardware resources
+ * @crtc: associated crtc to report vblank events to
+ * @data: platform data
  */
 struct mtk_disp_ovl {
struct mtk_ddp_comp ddp_comp;
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 10/30] drm/vc4/vc4_hdmi_regs: Mark some data sets as __maybe_unused

2020-11-12 Thread Lee Jones
The alternative is to move them into the source file that uses then,
but they are large and intrusive, so that strategy is being avoided.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/vc4/vc4_hdmi_regs.h:282:39: warning: ‘vc5_hdmi_hdmi1_fields’ 
defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/vc4/vc4_hdmi_regs.h:206:39: warning: ‘vc5_hdmi_hdmi0_fields’ 
defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/vc4/vc4_hdmi_regs.h:145:39: warning: ‘vc4_hdmi_fields’ defined 
but not used [-Wunused-const-variable=]

Cc: Eric Anholt 
Cc: Maxime Ripard 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h 
b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
index 7c6b4818f2455..96d764ebfe675 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
+++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
@@ -142,7 +142,7 @@ struct vc4_hdmi_register {
 #define VC5_RAM_REG(reg, offset)   _VC4_REG(VC5_RAM, reg, offset)
 #define VC5_RM_REG(reg, offset)_VC4_REG(VC5_RM, reg, offset)
 
-static const struct vc4_hdmi_register vc4_hdmi_fields[] = {
+static const struct vc4_hdmi_register __maybe_unused vc4_hdmi_fields[] = {
VC4_HD_REG(HDMI_M_CTL, 0x000c),
VC4_HD_REG(HDMI_MAI_CTL, 0x0014),
VC4_HD_REG(HDMI_MAI_THR, 0x0018),
@@ -203,7 +203,7 @@ static const struct vc4_hdmi_register vc4_hdmi_fields[] = {
VC4_HDMI_REG(HDMI_RAM_PACKET_START, 0x0400),
 };
 
-static const struct vc4_hdmi_register vc5_hdmi_hdmi0_fields[] = {
+static const struct vc4_hdmi_register __maybe_unused vc5_hdmi_hdmi0_fields[] = 
{
VC4_HD_REG(HDMI_DVP_CTL, 0x),
VC4_HD_REG(HDMI_MAI_CTL, 0x0010),
VC4_HD_REG(HDMI_MAI_THR, 0x0014),
@@ -279,7 +279,7 @@ static const struct vc4_hdmi_register 
vc5_hdmi_hdmi0_fields[] = {
VC5_CSC_REG(HDMI_CSC_34_33, 0x018),
 };
 
-static const struct vc4_hdmi_register vc5_hdmi_hdmi1_fields[] = {
+static const struct vc4_hdmi_register __maybe_unused vc5_hdmi_hdmi1_fields[] = 
{
VC4_HD_REG(HDMI_DVP_CTL, 0x),
VC4_HD_REG(HDMI_MAI_CTL, 0x0030),
VC4_HD_REG(HDMI_MAI_THR, 0x0034),
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 24/30] drm/nouveau/nvkm/core/firmware: Fix formatting, provide missing param description

2020-11-12 Thread Lee Jones
... and demote non-conformant kernel-doc header.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/nouveau/nvkm/core/firmware.c:71: warning: Function parameter 
or member 'subdev' not described in 'nvkm_firmware_get'
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c:71: warning: Function parameter 
or member 'fwname' not described in 'nvkm_firmware_get'
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c:71: warning: Function parameter 
or member 'ver' not described in 'nvkm_firmware_get'
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c:71: warning: Function parameter 
or member 'fw' not described in 'nvkm_firmware_get'
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c:106: warning: Function parameter 
or member 'fw' not described in 'nvkm_firmware_put'

Cc: Ben Skeggs 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Cc: nouv...@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c 
b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index 8b25367917ca0..ca1f8463cff51 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -58,9 +58,10 @@ nvkm_firmware_load_blob(const struct nvkm_subdev *subdev, 
const char *base,
 
 /**
  * nvkm_firmware_get - load firmware from the official nvidia/chip/ directory
- * @subdev subdevice that will use that firmware
- * @fwname name of firmware file to load
- * @fw firmware structure to load to
+ * @subdev:subdevice that will use that firmware
+ * @fwname:name of firmware file to load
+ * @ver:   firmware version to load
+ * @fw:firmware structure to load to
  *
  * Use this function to load firmware files in the form nvidia/chip/fwname.bin.
  * Firmware files released by NVIDIA will always follow this format.
@@ -98,7 +99,7 @@ nvkm_firmware_get(const struct nvkm_subdev *subdev, const 
char *fwname, int ver,
return -ENOENT;
 }
 
-/**
+/*
  * nvkm_firmware_put - release firmware loaded with nvkm_firmware_get
  */
 void
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 14/30] drm/amd/amdgpu/amdgpu_ring: Fix a bunch of function misdocumentation

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:63: warning: Excess function 
parameter 'adev' description in 'amdgpu_ring_alloc'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:122: warning: Excess function 
parameter 'adev' description in 'amdgpu_ring_commit'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
member 'max_dw' not described in 'amdgpu_ring_init'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
member 'irq_src' not described in 'amdgpu_ring_init'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
member 'irq_type' not described in 'amdgpu_ring_init'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Function parameter or 
member 'hw_prio' not described in 'amdgpu_ring_init'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Excess function 
parameter 'max_ndw' description in 'amdgpu_ring_init'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:167: warning: Excess function 
parameter 'nop' description in 'amdgpu_ring_init'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:285: warning: Excess function 
parameter 'adev' description in 'amdgpu_ring_fini'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:325: warning: Function parameter or 
member 'ring' not described in 'amdgpu_ring_emit_reg_write_reg_wait_helper'
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:325: warning: Excess function 
parameter 'adev' description in 'amdgpu_ring_emit_reg_write_reg_wait_helper'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: amd-...@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 2697b250dc326..a23b2079696a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -52,7 +52,6 @@
 /**
  * amdgpu_ring_alloc - allocate space on the ring buffer
  *
- * @adev: amdgpu_device pointer
  * @ring: amdgpu_ring structure holding ring information
  * @ndw: number of dwords to allocate in the ring buffer
  *
@@ -95,7 +94,8 @@ void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, 
uint32_t count)
amdgpu_ring_write(ring, ring->funcs->nop);
 }
 
-/** amdgpu_ring_generic_pad_ib - pad IB with NOP packets
+/**
+ * amdgpu_ring_generic_pad_ib - pad IB with NOP packets
  *
  * @ring: amdgpu_ring structure holding ring information
  * @ib: IB to add NOP packets to
@@ -112,7 +112,6 @@ void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, 
struct amdgpu_ib *ib)
  * amdgpu_ring_commit - tell the GPU to execute the new
  * commands on the ring buffer
  *
- * @adev: amdgpu_device pointer
  * @ring: amdgpu_ring structure holding ring information
  *
  * Update the wptr (write pointer) to tell the GPU to
@@ -156,7 +155,9 @@ void amdgpu_ring_undo(struct amdgpu_ring *ring)
  * @adev: amdgpu_device pointer
  * @ring: amdgpu_ring structure holding ring information
  * @max_ndw: maximum number of dw for ring alloc
- * @nop: nop packet for this ring
+ * @irq_src: interrupt source to use for this ring
+ * @irq_type: interrupt type to use for this ring
+ * @hw_prio: ring priority (NORMAL/HIGH)
  *
  * Initialize the driver information for the selected ring (all asics).
  * Returns 0 on success, error on failure.
@@ -276,7 +277,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct 
amdgpu_ring *ring,
 /**
  * amdgpu_ring_fini - tear down the driver ring struct.
  *
- * @adev: amdgpu_device pointer
  * @ring: amdgpu_ring structure holding ring information
  *
  * Tear down the driver information for the selected ring (all asics).
@@ -310,7 +310,7 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)
 /**
  * amdgpu_ring_emit_reg_write_reg_wait_helper - ring helper
  *
- * @adev: amdgpu_device pointer
+ * @ring: ring to write to
  * @reg0: register to write
  * @reg1: register to wait on
  * @ref: reference value to write/wait on
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 29/30] drm/amd/amdgpu/atombios_encoders: Remove set but unused variable 'backlight_level'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c: In function 
‘amdgpu_atombios_encoder_init_backlight’:
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c:174:5: warning: variable 
‘backlight_level’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Luben Tuikov 
Cc: amd-...@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c 
b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
index fa817ebff9804..af87505ad7d57 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
@@ -171,7 +171,6 @@ void amdgpu_atombios_encoder_init_backlight(struct 
amdgpu_encoder *amdgpu_encode
struct backlight_properties props;
struct amdgpu_backlight_privdata *pdata;
struct amdgpu_encoder_atom_dig *dig;
-   u8 backlight_level;
char bl_name[16];
 
/* Mac laptops with multiple GPUs use the gmux driver for backlight
@@ -207,7 +206,7 @@ void amdgpu_atombios_encoder_init_backlight(struct 
amdgpu_encoder *amdgpu_encode
 
pdata->encoder = amdgpu_encoder;
 
-   backlight_level = 
amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
+   amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
 
dig = amdgpu_encoder->enc_priv;
dig->bl_dev = bd;
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 06/30] drm/amd/amdgpu/amdgpu_kms: Fix misnaming of parameter 'dev'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:487: warning: Function parameter or 
member 'dev' not described in 'amdgpu_info_ioctl'
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:487: warning: Excess function 
parameter 'adev' description in 'amdgpu_info_ioctl'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: amd-...@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index cec9aad8bdfa9..98721ae931841 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -474,7 +474,7 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev,
 /**
  * amdgpu_info_ioctl - answer a device specific request.
  *
- * @adev: amdgpu device pointer
+ * @dev: drm device pointer
  * @data: request object
  * @filp: drm filp
  *
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 02/30] include: drm: drm_atomic: Artificially use 'crtc' to avoid 'not used' warning

2020-11-12 Thread Lee Jones
The precedent has already been set by other macros in the same file.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/vkms/vkms_drv.c:55:19: warning: variable ‘crtc’ set but not 
used [-Wunused-but-set-variable]
 55 | struct drm_crtc *crtc;
 | ^~~~

Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Thomas Zimmermann 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Rob Clark 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 include/drm/drm_atomic.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 413fd0ca56a8f..dc5e0fbecc04e 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -802,6 +802,7 @@ void drm_state_dump(struct drm_device *dev, struct 
drm_printer *p);
 (__i)++)   \
for_each_if ((__state)->crtcs[__i].ptr &&   \
 ((crtc) = (__state)->crtcs[__i].ptr,   \
+(void)(crtc) /* Only to avoid 
unused-but-set-variable warning */, \
 (old_crtc_state) = 
(__state)->crtcs[__i].old_state, 1))
 
 /**
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 13/30] drm/atmel-hlcdc/atmel_hlcdc_crtc: Apply correct formatting to struct docs

2020-11-12 Thread Lee Jones
And fix-up a misnamed member description.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c:33: warning: cannot understand 
function prototype: 'struct atmel_hlcdc_crtc_state '
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c:52: warning: cannot understand 
function prototype: 'struct atmel_hlcdc_crtc '

Cc: Sam Ravnborg 
Cc: Boris Brezillon 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Nicolas Ferre 
Cc: Alexandre Belloni 
Cc: Ludovic Desroches 
Cc: Jean-Jacques Hiblot 
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-ker...@lists.infradead.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
index c17571a3cc2bf..c58fa00b4848c 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
@@ -25,7 +25,7 @@
 #include "atmel_hlcdc_dc.h"
 
 /**
- * Atmel HLCDC CRTC state structure
+ * struct atmel_hlcdc_crtc_state - Atmel HLCDC CRTC state structure
  *
  * @base: base CRTC state
  * @output_mode: RGBXXX output mode
@@ -42,10 +42,10 @@ drm_crtc_state_to_atmel_hlcdc_crtc_state(struct 
drm_crtc_state *state)
 }
 
 /**
- * Atmel HLCDC CRTC structure
+ * struct atmel_hlcdc_crtc - Atmel HLCDC CRTC structure
  *
  * @base: base DRM CRTC structure
- * @hlcdc: pointer to the atmel_hlcdc structure provided by the MFD device
+ * @dc: pointer to the atmel_hlcdc structure provided by the MFD device
  * @event: pointer to the current page flip event
  * @id: CRTC id (returned by drm_crtc_index)
  */
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 07/30] drm/amd/amdgpu/amdgpu_fence: Fix some issues pertaining to function documentation

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:139: warning: Function parameter or 
member 'flags' not described in 'amdgpu_fence_emit'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:197: warning: Function parameter or 
member 'timeout' not described in 'amdgpu_fence_emit_polling'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:302: warning: Function parameter or 
member 't' not described in 'amdgpu_fence_fallback'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:302: warning: Excess function 
parameter 'work' description in 'amdgpu_fence_fallback'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:320: warning: Excess function 
parameter 'adev' description in 'amdgpu_fence_wait_empty'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:649: warning: Function parameter or 
member 'f' not described in 'amdgpu_fence_enable_signaling'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:649: warning: Excess function 
parameter 'fence' description in 'amdgpu_fence_enable_signaling'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:684: warning: Function parameter or 
member 'f' not described in 'amdgpu_fence_release'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:684: warning: Excess function 
parameter 'fence' description in 'amdgpu_fence_release'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:749: warning: Function parameter or 
member 'm' not described in 'amdgpu_debugfs_gpu_recover'
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:749: warning: Function parameter or 
member 'data' not described in 'amdgpu_debugfs_gpu_recover'

Cc: Alex Deucher 
Cc: "Christian König" 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: Sumit Semwal 
Cc: Jerome Glisse 
Cc: amd-...@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-me...@vger.kernel.org
Cc: linaro-mm-...@lists.linaro.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index fe2d495d08ab0..d56f4023ebb31 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -130,6 +130,7 @@ static u32 amdgpu_fence_read(struct amdgpu_ring *ring)
  *
  * @ring: ring the fence is associated with
  * @f: resulting fence object
+ * @flags: flags to pass into the subordinate .emit_fence() call
  *
  * Emits a fence command on the requested ring (all asics).
  * Returns 0 on success, -ENOMEM on failure.
@@ -187,6 +188,7 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct 
dma_fence **f,
  *
  * @ring: ring the fence is associated with
  * @s: resulting sequence number
+ * @timeout: the timeout for waiting in usecs
  *
  * Emits a fence command on the requested ring (all asics).
  * Used For polling fence.
@@ -294,7 +296,7 @@ bool amdgpu_fence_process(struct amdgpu_ring *ring)
 /**
  * amdgpu_fence_fallback - fallback for hardware interrupts
  *
- * @work: delayed work item
+ * @t: timer context used to obtain the pointer to ring structure
  *
  * Checks for fence activity.
  */
@@ -310,7 +312,6 @@ static void amdgpu_fence_fallback(struct timer_list *t)
 /**
  * amdgpu_fence_wait_empty - wait for all fences to signal
  *
- * @adev: amdgpu device pointer
  * @ring: ring index the fence is associated with
  *
  * Wait for all fences on the requested ring to signal (all asics).
@@ -639,7 +640,7 @@ static const char *amdgpu_fence_get_timeline_name(struct 
dma_fence *f)
 
 /**
  * amdgpu_fence_enable_signaling - enable signalling on fence
- * @fence: fence
+ * @f: fence
  *
  * This function is called with fence_queue lock held, and adds a callback
  * to fence_queue that checks if this fence is signaled, and if so it
@@ -675,7 +676,7 @@ static void amdgpu_fence_free(struct rcu_head *rcu)
 /**
  * amdgpu_fence_release - callback that fence can be freed
  *
- * @fence: fence
+ * @f: fence
  *
  * This function is called when the reference count becomes zero.
  * It just RCU schedules freeing up the fence.
@@ -740,7 +741,7 @@ static int amdgpu_debugfs_fence_info(struct seq_file *m, 
void *data)
return 0;
 }
 
-/**
+/*
  * amdgpu_debugfs_gpu_recover - manually trigger a gpu reset & recover
  *
  * Manually trigger a gpu reset at the next fence wait.
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 04/30] drm/via/via_dma: Remove set but unused variable 'agp_base'

2020-11-12 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/via/via_dma.c: In function ‘via_cmdbuf_jump’:
 drivers/gpu/drm/via/via_dma.c:596:11: warning: variable ‘agp_base’ set but not 
used [-Wunused-but-set-variable]

Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones 
---
 drivers/gpu/drm/via/via_dma.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/via/via_dma.c b/drivers/gpu/drm/via/via_dma.c
index 1208445e341de..cd56ffa3df589 100644
--- a/drivers/gpu/drm/via/via_dma.c
+++ b/drivers/gpu/drm/via/via_dma.c
@@ -593,13 +593,11 @@ static inline void via_dummy_bitblt(drm_via_private_t 
*dev_priv)
 
 static void via_cmdbuf_jump(drm_via_private_t *dev_priv)
 {
-   uint32_t agp_base;
uint32_t pause_addr_lo, pause_addr_hi;
uint32_t jump_addr_lo, jump_addr_hi;
volatile uint32_t *last_pause_ptr;
uint32_t dma_low_save1, dma_low_save2;
 
-   agp_base = dev_priv->dma_offset + (uint32_t) dev_priv->agpAddr;
via_align_cmd(dev_priv, HC_HAGPBpID_JUMP, 0, &jump_addr_hi,
  &jump_addr_lo, 0);
 
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [git pull] drm next pull for 5.10-rc1

2020-11-12 Thread Lyude Paul
JFYI-looking at this today

On Mon, 2020-11-09 at 14:52 +0300, Kirill A. Shutemov wrote:
> On Wed, Nov 04, 2020 at 04:58:14PM -0500, Lyude Paul wrote:
> > ACK, I will send out a patch for this asap
> 
> Any update. AFAICS, v5.10-rc3 is still buggy.
> 

-- 
Sincerely,
   Lyude Paul (she/her)
   Software Engineer at Red Hat
   
Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 4/7] drm/radeon: Pin buffers while they are vmap'ed

2020-11-12 Thread Christian König

Am 12.11.20 um 14:21 schrieb Thomas Zimmermann:

In order to avoid eviction of vmap'ed buffers, pin them in their GEM
object's vmap implementation. Unpin them in the vunmap implementation.
This is needed to make generic fbdev support work reliably. Without,
the buffer object could be evicted while fbdev flushed its shadow buffer.

In difference to the PRIME pin/unpin functions, the vmap code does not
modify the BOs prime_shared_count, so a vmap-pinned BO does not count as
shared.

The actual pin location is not important as the vmap call returns
information on how to access the buffer. Callers that require a
specific location should explicitly pin the BO before vmapping it.


Well is the buffer supposed to be scanned out?

If yes then the pin location is actually rather important since the 
hardware can only scan out from VRAM.


Regards,
Christian.



Signed-off-by: Thomas Zimmermann 
---
  drivers/gpu/drm/radeon/radeon_gem.c | 51 +++--
  1 file changed, 49 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
b/drivers/gpu/drm/radeon/radeon_gem.c
index d2876ce3bc9e..eaf7fc9a7b07 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -226,6 +226,53 @@ static int radeon_gem_handle_lockup(struct radeon_device 
*rdev, int r)
return r;
  }
  
+static int radeon_gem_object_vmap(struct drm_gem_object *obj, struct dma_buf_map *map)

+{
+   static const uint32_t any_domain = RADEON_GEM_DOMAIN_VRAM |
+  RADEON_GEM_DOMAIN_GTT |
+  RADEON_GEM_DOMAIN_CPU;
+
+   struct radeon_bo *bo = gem_to_radeon_bo(obj);
+   int ret;
+
+   ret = radeon_bo_reserve(bo, false);
+   if (ret)
+   return ret;
+
+   /* pin buffer at its current location */
+   ret = radeon_bo_pin(bo, any_domain, NULL);
+   if (ret)
+   goto err_radeon_bo_unreserve;
+
+   ret = drm_gem_ttm_vmap(obj, map);
+   if (ret)
+   goto err_radeon_bo_unpin;
+
+   radeon_bo_unreserve(bo);
+
+   return 0;
+
+err_radeon_bo_unpin:
+   radeon_bo_unpin(bo);
+err_radeon_bo_unreserve:
+   radeon_bo_unreserve(bo);
+   return ret;
+}
+
+static void radeon_gem_object_vunmap(struct drm_gem_object *obj, struct 
dma_buf_map *map)
+{
+   struct radeon_bo *bo = gem_to_radeon_bo(obj);
+   int ret;
+
+   ret = radeon_bo_reserve(bo, false);
+   if (ret)
+   return;
+
+   drm_gem_ttm_vunmap(obj, map);
+   radeon_bo_unpin(bo);
+   radeon_bo_unreserve(bo);
+}
+
  static const struct drm_gem_object_funcs radeon_gem_object_funcs = {
.free = radeon_gem_object_free,
.open = radeon_gem_object_open,
@@ -234,8 +281,8 @@ static const struct drm_gem_object_funcs 
radeon_gem_object_funcs = {
.pin = radeon_gem_prime_pin,
.unpin = radeon_gem_prime_unpin,
.get_sg_table = radeon_gem_prime_get_sg_table,
-   .vmap = drm_gem_ttm_vmap,
-   .vunmap = drm_gem_ttm_vunmap,
+   .vmap = radeon_gem_object_vmap,
+   .vunmap = radeon_gem_object_vunmap,
  };
  
  /*


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 11/30] drm/tegra: dc: Support OPP and SoC core voltage scaling

2020-11-12 Thread Mark Brown
On Thu, Nov 12, 2020 at 07:59:36PM +0300, Dmitry Osipenko wrote:
> 11.11.2020 14:55, Mark Brown пишет:
> > On Wed, Nov 11, 2020 at 12:23:41AM +0300, Dmitry Osipenko wrote:

> >> I already changed that code to use regulator_get_optional() for v2.

> > That doesn't look entirely appropriate given that the core does most
> > likely require some kind of power to operate.

> We will need to do this because older DTBs won't have that regulator and
> we want to keep them working.

> Also, some device-trees won't have that regulator anyways because board
> schematics isn't available, and thus, we can't fix them.

This is what dummy supplies are for?

> >> Regarding the enumerating supported voltage.. I think this should be
> >> done by the OPP core, but regulator core doesn't work well if
> >> regulator_get() is invoked more than one time for the same device, at
> >> least there is a loud debugfs warning about an already existing

> > I don't understand why this would be an issue - if nothing else the core
> > could just offer an interface to trigger the check.

> It's not an issue, I just described what happens when device driver
> tries to get a regulator twice.

> There was an issue once that check is added to the regulator core code.
> But perhaps not worth to discuss it for now because I don't remember
> details.

So there's no known obstacle to putting enumeration of supported
voltages into the OPP core then?  I'm a bit confused here.

> >> directory for a regulator. It's easy to check whether the debug
> >> directory exists before creating it, like thermal framework does it for
> >> example, but then there were some other more difficult issues.. I don't
> >> recall what they were right now. Perhaps will be easier to simply get a
> >> error from regulator_set_voltage() for now because it shouldn't ever
> >> happen in practice, unless device-tree has wrong constraints.

> > The constraints might not be wrong, there might be some board which has
> > a constraint somewhere for 

> In this case board's DT shouldn't specify unsupportable OPPs.

Ah, so each board duplicates the OPP tables then, or there's an
expectation that if there's some limit then they'll copy and modify the
table?  If that's the case then it's a bit redundant to do filtering
indeed.


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/msm: adreno: Make speed-bin support generic

2020-11-12 Thread Rob Clark
On Thu, Nov 12, 2020 at 7:49 AM Akhil P Oommen  wrote:
>
> So far a530v2 gpu has support for detecting its supported opps
> based on a fuse value called speed-bin. This patch makes this
> support generic across gpu families. This is in preparation to
> extend speed-bin support to a6x family.
>
> Signed-off-by: Akhil P Oommen 
> ---
> This patch is rebased on top of msm-next-staging branch in rob's tree.
>
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c  | 34 --
>  drivers/gpu/drm/msm/adreno/adreno_device.c |  4 ++
>  drivers/gpu/drm/msm/adreno/adreno_gpu.c| 71 
> ++
>  drivers/gpu/drm/msm/adreno/adreno_gpu.h|  5 +++
>  4 files changed, 80 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
> b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 8fa5c91..7d42321 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1531,38 +1531,6 @@ static const struct adreno_gpu_funcs funcs = {
> .get_timestamp = a5xx_get_timestamp,
>  };
>
> -static void check_speed_bin(struct device *dev)
> -{
> -   struct nvmem_cell *cell;
> -   u32 val;
> -
> -   /*
> -* If the OPP table specifies a opp-supported-hw property then we have
> -* to set something with dev_pm_opp_set_supported_hw() or the table
> -* doesn't get populated so pick an arbitrary value that should
> -* ensure the default frequencies are selected but not conflict with 
> any
> -* actual bins
> -*/
> -   val = 0x80;
> -
> -   cell = nvmem_cell_get(dev, "speed_bin");
> -
> -   if (!IS_ERR(cell)) {
> -   void *buf = nvmem_cell_read(cell, NULL);
> -
> -   if (!IS_ERR(buf)) {
> -   u8 bin = *((u8 *) buf);
> -
> -   val = (1 << bin);
> -   kfree(buf);
> -   }
> -
> -   nvmem_cell_put(cell);
> -   }
> -
> -   dev_pm_opp_set_supported_hw(dev, &val, 1);
> -}
> -
>  struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
>  {
> struct msm_drm_private *priv = dev->dev_private;
> @@ -1588,8 +1556,6 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
>
> a5xx_gpu->lm_leakage = 0x4E001A;
>
> -   check_speed_bin(&pdev->dev);
> -
> ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 4);
> if (ret) {
> a5xx_destroy(&(a5xx_gpu->base.base));
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
> b/drivers/gpu/drm/msm/adreno/adreno_device.c
> index 87c8b03..e0ff16c 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
> @@ -18,6 +18,8 @@ bool snapshot_debugbus = false;
>  MODULE_PARM_DESC(snapshot_debugbus, "Include debugbus sections in GPU 
> devcoredump (if not fused off)");
>  module_param_named(snapshot_debugbus, snapshot_debugbus, bool, 0600);
>
> +const u32 a530v2_speedbins[] = {0, 1, 2, 3, 4, 5, 6, 7};
> +
>  static const struct adreno_info gpulist[] = {
> {
> .rev   = ADRENO_REV(2, 0, 0, 0),
> @@ -163,6 +165,8 @@ static const struct adreno_info gpulist[] = {
> ADRENO_QUIRK_FAULT_DETECT_MASK,
> .init = a5xx_gpu_init,
> .zapfw = "a530_zap.mdt",
> +   .speedbins = a530v2_speedbins,
> +   .speedbins_count = ARRAY_SIZE(a530v2_speedbins),
> }, {
> .rev = ADRENO_REV(5, 4, 0, 2),
> .revn = 540,
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c 
> b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> index f21561d..cdd0c11 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> @@ -14,6 +14,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include "adreno_gpu.h"
>  #include "msm_gem.h"
> @@ -891,6 +892,69 @@ void adreno_gpu_ocmem_cleanup(struct adreno_ocmem 
> *adreno_ocmem)
>adreno_ocmem->hdl);
>  }
>
> +static int adreno_set_supported_hw(struct device *dev,
> +   struct adreno_gpu *adreno_gpu)
> +{
> +   u8 speedbins_count = adreno_gpu->info->speedbins_count;
> +   const u32 *speedbins = adreno_gpu->info->speedbins;
> +   struct nvmem_cell *cell;
> +   u32 bin, i;
> +   u32 val = 0;
> +   void *buf, *opp_table;
> +
> +   cell = nvmem_cell_get(dev, "speed_bin");
> +   /*
> +* -ENOENT means that the platform doesn't support speedbin which is
> +* fine
> +*/
> +   if (PTR_ERR(cell) == -ENOENT)
> +   return 0;
> +   else if (IS_ERR(cell))
> +   return PTR_ERR(cell);
> +
> +   /* A speedbin table is must if the platform supports speedbin */
> +   if (!speedbins) {
> +   DRM_DEV_ERROR(dev, "speed-bin table is missing\n");
> +   return -ENOENT;

Hmm, this means that hw which supports speed-bin

Re: [PATCH] drm/msm: adreno: Make speed-bin support generic

2020-11-12 Thread Jordan Crouse
On Thu, Nov 12, 2020 at 09:19:04PM +0530, Akhil P Oommen wrote:
> So far a530v2 gpu has support for detecting its supported opps
> based on a fuse value called speed-bin. This patch makes this
> support generic across gpu families. This is in preparation to
> extend speed-bin support to a6x family.
> 
> Signed-off-by: Akhil P Oommen 
> ---
> This patch is rebased on top of msm-next-staging branch in rob's tree.
> 
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c  | 34 --
>  drivers/gpu/drm/msm/adreno/adreno_device.c |  4 ++
>  drivers/gpu/drm/msm/adreno/adreno_gpu.c| 71 
> ++
>  drivers/gpu/drm/msm/adreno/adreno_gpu.h|  5 +++
>  4 files changed, 80 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
> b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 8fa5c91..7d42321 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1531,38 +1531,6 @@ static const struct adreno_gpu_funcs funcs = {
>   .get_timestamp = a5xx_get_timestamp,
>  };
>  
> -static void check_speed_bin(struct device *dev)
> -{
> - struct nvmem_cell *cell;
> - u32 val;
> -
> - /*
> -  * If the OPP table specifies a opp-supported-hw property then we have
> -  * to set something with dev_pm_opp_set_supported_hw() or the table
> -  * doesn't get populated so pick an arbitrary value that should
> -  * ensure the default frequencies are selected but not conflict with any
> -  * actual bins
> -  */
> - val = 0x80;
> -
> - cell = nvmem_cell_get(dev, "speed_bin");
> -
> - if (!IS_ERR(cell)) {
> - void *buf = nvmem_cell_read(cell, NULL);
> -
> - if (!IS_ERR(buf)) {
> - u8 bin = *((u8 *) buf);
> -
> - val = (1 << bin);
> - kfree(buf);
> - }
> -
> - nvmem_cell_put(cell);
> - }
> -
> - dev_pm_opp_set_supported_hw(dev, &val, 1);
> -}
> -
>  struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
>  {
>   struct msm_drm_private *priv = dev->dev_private;
> @@ -1588,8 +1556,6 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
>  
>   a5xx_gpu->lm_leakage = 0x4E001A;
>  
> - check_speed_bin(&pdev->dev);
> -
>   ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 4);
>   if (ret) {
>   a5xx_destroy(&(a5xx_gpu->base.base));
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
> b/drivers/gpu/drm/msm/adreno/adreno_device.c
> index 87c8b03..e0ff16c 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
> @@ -18,6 +18,8 @@ bool snapshot_debugbus = false;
>  MODULE_PARM_DESC(snapshot_debugbus, "Include debugbus sections in GPU 
> devcoredump (if not fused off)");
>  module_param_named(snapshot_debugbus, snapshot_debugbus, bool, 0600);
>  
> +const u32 a530v2_speedbins[] = {0, 1, 2, 3, 4, 5, 6, 7};
> +
>  static const struct adreno_info gpulist[] = {
>   {
>   .rev   = ADRENO_REV(2, 0, 0, 0),
> @@ -163,6 +165,8 @@ static const struct adreno_info gpulist[] = {
>   ADRENO_QUIRK_FAULT_DETECT_MASK,
>   .init = a5xx_gpu_init,
>   .zapfw = "a530_zap.mdt",
> + .speedbins = a530v2_speedbins,
> + .speedbins_count = ARRAY_SIZE(a530v2_speedbins),
>   }, {
>   .rev = ADRENO_REV(5, 4, 0, 2),
>   .revn = 540,
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c 
> b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> index f21561d..cdd0c11 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> @@ -14,6 +14,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include "adreno_gpu.h"
>  #include "msm_gem.h"
> @@ -891,6 +892,69 @@ void adreno_gpu_ocmem_cleanup(struct adreno_ocmem 
> *adreno_ocmem)
>  adreno_ocmem->hdl);
>  }
>  
> +static int adreno_set_supported_hw(struct device *dev,
> + struct adreno_gpu *adreno_gpu)
> +{
> + u8 speedbins_count = adreno_gpu->info->speedbins_count;
> + const u32 *speedbins = adreno_gpu->info->speedbins;

We don't need to make this generic and put it in the table. Just call the
function from the target specific code and pass the speedbin array and size from
there.

> + struct nvmem_cell *cell;
> + u32 bin, i;
> + u32 val = 0;
> + void *buf, *opp_table;
> +
> + cell = nvmem_cell_get(dev, "speed_bin");
> + /*
> +  * -ENOENT means that the platform doesn't support speedbin which is
> +  * fine
> +  */
> + if (PTR_ERR(cell) == -ENOENT)
> + return 0;
> + else if (IS_ERR(cell))
> + return PTR_ERR(cell);
> +
> + /* A speedbin table is must if the platform supports speedbin */
> + if (!speedbins) {
> + DRM_DEV_ERROR(dev, "speed-bin table is missing\n");
> + re

[PULL] drm-intel-gt-next

2020-11-12 Thread Joonas Lahtinen
Hi Dave & Daniel,

Here goes the drm-intel-gt-next PR for 5.11.

Most importantly there is a healthy chunk of Tigerlake
related fixes and a fix for user reported issue #2381 where
graphics output would stop at "switching to inteldrmfb from
simple".

Fixes to DMA mapped sg usage in i915 to unblock intel iommu
rework. Fixes to previously introduced WW mutex rework.

We're enabling eLLC for displayable buffers on SKL+. Plenty
of fixes to driver unbind/bind cycle. The GuC firmware
version is being updated (that just loads HuC for now).

The usual amount of fixes for CI found corner cases.

Expect a few conflicts with drm-intel-next (resolved in rerere)
as the platform enabling ones go there. I'll backmerge drm-next
once you've accepted this to pull all the changes to gt-next.

The -next-fixes and -fixes would come from Jani after this is
accepted, too.

Regards, Joonas

***

drm-intel-gt-next-2020-11-12-1:

Cross-subsystem Changes:
- DMA mapped scatterlist fixes in i915 to unblock merging of
  https://lkml.org/lkml/2020/9/27/70 (Tvrtko, Tom)

Driver Changes:

- Fix for user reported issue #2381 (Graphical output stops with "switching to 
inteldrmfb from simple"):
  Mark ininitial fb obj as WT on eLLC machines to avoid rcu lockup during fbdev 
init (Ville, Chris)
- Fix for Tigerlake (and earlier) to avoid spurious empty CSB events leading to 
hang (Chris, Bruce)
- Delay execlist processing for Tigerlake to avoid hang (Chris)
- Fix for Tigerlake RCS engine health check through heartbeat (Chris)
- Fix for Tigerlake reserved MOCS entries (Ayaz, Chris)
- Fix Media power gate sequence on Tigerlake (Rodrigo)
- Enable eLLC caching of display buffers for SKL+ (Ville)
- Support parsing of oversize batches on Gen9 (Matt, Chris)
- Exclude low pages (128KiB) of stolen from use to avoid thrashing during reset 
(Chris)
- Flush engines before Tigerlake breadcrumbs (Chris)

- Use the local HWSP offset during submission (Chris)
- Flush coherency domains on first set-domain-ioctl (Chris, Zbigniew)
- Use the active reference on the vma while capturing to avoid use-after-free 
(Chris)
- Fix MOCS PTE setting for gen9+ (Ville)
- Avoid NULL dereference on IPS driver callback while unbinding i915 (Chris)
- Avoid NULL dereference from PT/PD stash allocation error (Matt)
- Hold request reference for canceling an active context (Chris)
- Avoid infinite loop on x86-32 when mapping a lot of objects (Chris)
- Disallow WC mappings when processor doesn't support them (Chris)
- Return correct error in i915_gem_object_copy_blt() error path (Dan)
- Return correct error in intel_context_create_request() error path (Maarten)
- Tune down GuC communication enabled/disabled messages to debug (Jani)
- Fix rebased commit "Remove i915_request.lock requirement for execution 
callbacks" (Chris)
- Cancel outstanding work after disabling heartbeats on an engine (Chris)
- Signal cancelled requests (Chris)
- Retire cancelled requests on unload (Chris)
- Scrub HW state on driver remove (Chris)
- Undo forced context restores after trivial preemptions (Chris)
- Handle PCI unbind in PMU code (Tvrtko)
- Fix CPU hotplug with multiple GPUs in PMU code (Trtkko)
- Correctly set SFC capability for video engines (Venkata)

- Update GuC code to use firmware v49.0.1 (John, Matthew B., Daniele, Oscar, 
Michel, Rodrigo, Michal)
- Improve GuC warnings on loading failure (John)
- Avoid ownership race in buffer pool by clearing age (Chris)
- Use MMIO to read CSB in case of failure (Chris, Mika)
- Show engine properties in engine state dump to indicate changes (Chris, 
Joonas)
- Break up error capture compression loops with cond_resched() (Chris)
- Reduce GPU error capture mutex hold time to avoid khungtaskd (Chris)
- Serialise debugfs i915_gem_objects with ctx->mutex (Chris)
- Always test execution status on closing the context and close if not 
persistent (Chris)
- Avoid mixing integer types during batch copies (Chris, Jared)
- Skip over MI_NOOP when parsing to avoid overhead (Chris)
- Hold onto an explicit ref to i915_vma_work.pinned (Chris)
- Perform all asynchronous waits prior to marking payload start (Chris)
- Pull phys pread/pwrite implementations to the backend (Matt)

- Improve record of hung engines in error state (Tvrtko)
- Allow backends to override pread implementation (Matt)
- Reinforce LRC poisoning checks to confirm context survives execution (Chris)
- Fix memory region max size calculation (Matt)
- Fix order when adding blocks to memory region (Matt)
- Eliminate unused intel_virtual_engine_get_sibling func (Chris)
- Cleanup kasan warning for on-stack (unsigned long) casting (Chris)
- Onion unwind for scratch page allocation failure (Chris)
- Poison stolen pages before use (Chris)
- Selftest improvements (Chris)
The following changes since commit e0ee152fce25dc9269c7ea5280c98aa4b3682759:

  drm/i915: Unlock the shared hwsp_gtt object after pinning (2020-09-07 
15:08:11 +0300)

are available in the Git repository at:

  git://anongit.freedesktop.org/drm/drm-inte

Re: [PATCH v9 3/5] MAINTAINERS: Add entry for Samsung interconnect drivers

2020-11-12 Thread Krzysztof Kozlowski
On Thu, Nov 12, 2020 at 03:09:29PM +0100, Sylwester Nawrocki wrote:
> Add maintainers entry for the Samsung SoC interconnect drivers, this
> currently includes the Exynos generic interconnect driver.
> 
> Reviewed-by: Chanwoo Choi 
> Signed-off-by: Sylwester Nawrocki 
> ---
> Changes for v9:
>  - add linux-samsung-soc ML,
>  - fixed Artur's last name spelling,
>  - whole entry moved to maintain alphabetical order,
>  - added missing traling '/' to directory path.
> 
> Changes since v7:
>  - new patch.
> ---
>  MAINTAINERS | 8 
>  1 file changed, 8 insertions(+)
> 

Reviewed-by: Krzysztof Kozlowski 

Best regards,
Krzysztof
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] amdgpu/test: deadlock test for CZ family and RV family

2020-11-12 Thread Andrey Grodzovsky

Reviewed-by: Andrey Grodzovsky 

Andrey

On 11/12/20 10:35 AM, rajib.mahapa...@amd.com wrote:

From: Rajib Mahapatra 

It enables the test for RV2 and PCO, whole GPU reset is not supported
for others.

Signed-off-by: Rajib Mahapatra 
Change-Id: Id51605d07b334ecea7a88b3c95fdd57008a4458d
---
  include/drm/amdgpu_drm.h  | 15 +++
  tests/amdgpu/deadlock_tests.c | 18 --
  2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index be84e43c..bb7ded25 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -995,6 +995,21 @@ struct drm_amdgpu_info_vce_clock_table {
  #define AMDGPU_FAMILY_AI  141 /* Vega10 */
  #define AMDGPU_FAMILY_RV  142 /* Raven */
  
+/*

+ * Asic Rev
+ */
+#define RAVEN_A0 0x01
+#define PICASSO_A0 0x41
+
+#define RAVEN2_A0 0x81
+#define RAVEN_UNKNOWN 0xFF
+
+#define PICASSO_15D8_REV_E3 0xE3
+
+#define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < 
RAVEN_UNKNOWN)
+#define ASICREV_IS_PICASSO(eChipRev) ((eChipRev >= PICASSO_A0) && (eChipRev < 
RAVEN2_A0))
+#define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < 
PICASSO_15D8_REV_E3))
+
  #if defined(__cplusplus)
  }
  #endif
diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
index a6c2635d..3be99dc8 100644
--- a/tests/amdgpu/deadlock_tests.c
+++ b/tests/amdgpu/deadlock_tests.c
@@ -126,8 +126,22 @@ CU_BOOL suite_deadlock_tests_enable(void)
if (device_handle->info.family_id != AMDGPU_FAMILY_VI &&
device_handle->info.family_id != AMDGPU_FAMILY_AI &&
device_handle->info.family_id != AMDGPU_FAMILY_CI) {
-   printf("\n\nGPU reset is not enabled for the ASIC, deadlock suite 
disabled\n");
-   enable = CU_FALSE;
+   if (device_handle->info.family_id == AMDGPU_FAMILY_CZ) {
+   printf("\n\nWhole GPU reset is not supported for the ASIC, 
deadlock suite disabled\n");Reviewed-by: Andrey Grodzovsky 

+   enable = CU_FALSE;
+   } else if (device_handle->info.family_id == AMDGPU_FAMILY_RV) {
+   if 
(ASICREV_IS_RAVEN2(device_handle->info.chip_external_rev)) {
+   enable = CU_TRUE;
+   } else if 
(ASICREV_IS_PICASSO(device_handle->info.chip_external_rev)) {
+   enable = CU_TRUE;
+   } else {
+   printf("\n\nWhole GPU reset is not supported for the 
ASIC, deadlock suite disabled\n");
+   enable = CU_FALSE;
+   }
+   } else {
+   printf("\n\nGPU reset is not enabled for the ASIC, deadlock 
suite disabled\n");
+   enable = CU_FALSE;
+   }
}
  
  	if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/msm: adreno: Make speed-bin support generic

2020-11-12 Thread Akhil P Oommen
So far a530v2 gpu has support for detecting its supported opps
based on a fuse value called speed-bin. This patch makes this
support generic across gpu families. This is in preparation to
extend speed-bin support to a6x family.

Signed-off-by: Akhil P Oommen 
---
This patch is rebased on top of msm-next-staging branch in rob's tree.

 drivers/gpu/drm/msm/adreno/a5xx_gpu.c  | 34 --
 drivers/gpu/drm/msm/adreno/adreno_device.c |  4 ++
 drivers/gpu/drm/msm/adreno/adreno_gpu.c| 71 ++
 drivers/gpu/drm/msm/adreno/adreno_gpu.h|  5 +++
 4 files changed, 80 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c 
b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 8fa5c91..7d42321 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1531,38 +1531,6 @@ static const struct adreno_gpu_funcs funcs = {
.get_timestamp = a5xx_get_timestamp,
 };
 
-static void check_speed_bin(struct device *dev)
-{
-   struct nvmem_cell *cell;
-   u32 val;
-
-   /*
-* If the OPP table specifies a opp-supported-hw property then we have
-* to set something with dev_pm_opp_set_supported_hw() or the table
-* doesn't get populated so pick an arbitrary value that should
-* ensure the default frequencies are selected but not conflict with any
-* actual bins
-*/
-   val = 0x80;
-
-   cell = nvmem_cell_get(dev, "speed_bin");
-
-   if (!IS_ERR(cell)) {
-   void *buf = nvmem_cell_read(cell, NULL);
-
-   if (!IS_ERR(buf)) {
-   u8 bin = *((u8 *) buf);
-
-   val = (1 << bin);
-   kfree(buf);
-   }
-
-   nvmem_cell_put(cell);
-   }
-
-   dev_pm_opp_set_supported_hw(dev, &val, 1);
-}
-
 struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
 {
struct msm_drm_private *priv = dev->dev_private;
@@ -1588,8 +1556,6 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
 
a5xx_gpu->lm_leakage = 0x4E001A;
 
-   check_speed_bin(&pdev->dev);
-
ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 4);
if (ret) {
a5xx_destroy(&(a5xx_gpu->base.base));
diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 87c8b03..e0ff16c 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -18,6 +18,8 @@ bool snapshot_debugbus = false;
 MODULE_PARM_DESC(snapshot_debugbus, "Include debugbus sections in GPU 
devcoredump (if not fused off)");
 module_param_named(snapshot_debugbus, snapshot_debugbus, bool, 0600);
 
+const u32 a530v2_speedbins[] = {0, 1, 2, 3, 4, 5, 6, 7};
+
 static const struct adreno_info gpulist[] = {
{
.rev   = ADRENO_REV(2, 0, 0, 0),
@@ -163,6 +165,8 @@ static const struct adreno_info gpulist[] = {
ADRENO_QUIRK_FAULT_DETECT_MASK,
.init = a5xx_gpu_init,
.zapfw = "a530_zap.mdt",
+   .speedbins = a530v2_speedbins,
+   .speedbins_count = ARRAY_SIZE(a530v2_speedbins),
}, {
.rev = ADRENO_REV(5, 4, 0, 2),
.revn = 540,
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index f21561d..cdd0c11 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "adreno_gpu.h"
 #include "msm_gem.h"
@@ -891,6 +892,69 @@ void adreno_gpu_ocmem_cleanup(struct adreno_ocmem 
*adreno_ocmem)
   adreno_ocmem->hdl);
 }
 
+static int adreno_set_supported_hw(struct device *dev,
+   struct adreno_gpu *adreno_gpu)
+{
+   u8 speedbins_count = adreno_gpu->info->speedbins_count;
+   const u32 *speedbins = adreno_gpu->info->speedbins;
+   struct nvmem_cell *cell;
+   u32 bin, i;
+   u32 val = 0;
+   void *buf, *opp_table;
+
+   cell = nvmem_cell_get(dev, "speed_bin");
+   /*
+* -ENOENT means that the platform doesn't support speedbin which is
+* fine
+*/
+   if (PTR_ERR(cell) == -ENOENT)
+   return 0;
+   else if (IS_ERR(cell))
+   return PTR_ERR(cell);
+
+   /* A speedbin table is must if the platform supports speedbin */
+   if (!speedbins) {
+   DRM_DEV_ERROR(dev, "speed-bin table is missing\n");
+   return -ENOENT;
+   }
+
+   buf = nvmem_cell_read(cell, NULL);
+   if (IS_ERR(buf)) {
+   nvmem_cell_put(cell);
+   return PTR_ERR(buf);
+   }
+
+   bin = *((u32 *) buf);
+
+   for (i = 0; i < speedbins_count; i++) {
+   if (bin == speedbins[i]) {
+   val = (1 << i);
+   break;
+   

[PATCH] amdgpu/test: deadlock test for CZ family and RV family

2020-11-12 Thread rajib . mahapatra
From: Rajib Mahapatra 

It enables the test for RV2 and PCO, whole GPU reset is not supported
for others.

Signed-off-by: Rajib Mahapatra 
Change-Id: Id51605d07b334ecea7a88b3c95fdd57008a4458d
---
 include/drm/amdgpu_drm.h  | 15 +++
 tests/amdgpu/deadlock_tests.c | 18 --
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index be84e43c..bb7ded25 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -995,6 +995,21 @@ struct drm_amdgpu_info_vce_clock_table {
 #define AMDGPU_FAMILY_AI   141 /* Vega10 */
 #define AMDGPU_FAMILY_RV   142 /* Raven */
 
+/*
+ * Asic Rev
+ */
+#define RAVEN_A0 0x01
+#define PICASSO_A0 0x41
+
+#define RAVEN2_A0 0x81
+#define RAVEN_UNKNOWN 0xFF
+
+#define PICASSO_15D8_REV_E3 0xE3
+
+#define ASICREV_IS_RAVEN(eChipRev) ((eChipRev >= RAVEN_A0) && eChipRev < 
RAVEN_UNKNOWN)
+#define ASICREV_IS_PICASSO(eChipRev) ((eChipRev >= PICASSO_A0) && (eChipRev < 
RAVEN2_A0))
+#define ASICREV_IS_RAVEN2(eChipRev) ((eChipRev >= RAVEN2_A0) && (eChipRev < 
PICASSO_15D8_REV_E3))
+
 #if defined(__cplusplus)
 }
 #endif
diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
index a6c2635d..3be99dc8 100644
--- a/tests/amdgpu/deadlock_tests.c
+++ b/tests/amdgpu/deadlock_tests.c
@@ -126,8 +126,22 @@ CU_BOOL suite_deadlock_tests_enable(void)
if (device_handle->info.family_id != AMDGPU_FAMILY_VI &&
device_handle->info.family_id != AMDGPU_FAMILY_AI &&
device_handle->info.family_id != AMDGPU_FAMILY_CI) {
-   printf("\n\nGPU reset is not enabled for the ASIC, deadlock 
suite disabled\n");
-   enable = CU_FALSE;
+   if (device_handle->info.family_id == AMDGPU_FAMILY_CZ) {
+   printf("\n\nWhole GPU reset is not supported for the 
ASIC, deadlock suite disabled\n");
+   enable = CU_FALSE;
+   } else if (device_handle->info.family_id == AMDGPU_FAMILY_RV) {
+   if 
(ASICREV_IS_RAVEN2(device_handle->info.chip_external_rev)) {
+   enable = CU_TRUE;
+   } else if 
(ASICREV_IS_PICASSO(device_handle->info.chip_external_rev)) {
+   enable = CU_TRUE;
+   } else {
+   printf("\n\nWhole GPU reset is not supported 
for the ASIC, deadlock suite disabled\n");
+   enable = CU_FALSE;
+   }
+   } else {
+   printf("\n\nGPU reset is not enabled for the ASIC, 
deadlock suite disabled\n");
+   enable = CU_FALSE;
+   }
}
 
if (device_handle->info.family_id >= AMDGPU_FAMILY_AI)
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/2] drm/mcde: Break out DSI set-up routine

2020-11-12 Thread Linus Walleij
To be able to support DPI without messing things up we
first break out the DSI set-up to a separate function.

Cc: Stephan Gerhold 
Cc: phone-de...@vger.kernel.org
Cc: upstream...@lists.sr.ht
Signed-off-by: Linus Walleij 
---
 drivers/gpu/drm/mcde/mcde_display.c | 135 +++-
 1 file changed, 75 insertions(+), 60 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_display.c 
b/drivers/gpu/drm/mcde/mcde_display.c
index c271e5bf042e..66a07e340f8a 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -860,74 +860,44 @@ static int mcde_dsi_get_pkt_div(int ppl, int fifo_size)
return 1;
 }
 
-static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
-   struct drm_crtc_state *cstate,
-   struct drm_plane_state *plane_state)
+static void mcde_setup_dsi(struct mcde *mcde, const struct drm_display_mode 
*mode,
+  int cpp, int *fifo_wtrmrk_lvl, int 
*dsi_formatter_frame,
+  int *dsi_pkt_size)
 {
-   struct drm_crtc *crtc = &pipe->crtc;
-   struct drm_plane *plane = &pipe->plane;
-   struct drm_device *drm = crtc->dev;
-   struct mcde *mcde = to_mcde(drm);
-   const struct drm_display_mode *mode = &cstate->mode;
-   struct drm_framebuffer *fb = plane->state->fb;
-   u32 format = fb->format->format;
u32 formatter_ppl = mode->hdisplay; /* pixels per line */
u32 formatter_lpf = mode->vdisplay; /* lines per frame */
-   int pkt_size, fifo_wtrmrk;
-   int cpp = fb->format->cpp[0];
+   int formatter_frame;
int formatter_cpp;
-   struct drm_format_name_buf tmp;
-   u32 formatter_frame;
+   int fifo_wtrmrk;
u32 pkt_div;
+   int pkt_size;
u32 val;
-   int ret;
 
-   /* This powers up the entire MCDE block and the DSI hardware */
-   ret = regulator_enable(mcde->epod);
-   if (ret) {
-   dev_err(drm->dev, "can't re-enable EPOD regulator\n");
-   return;
-   }
-
-   dev_info(drm->dev, "enable MCDE, %d x %d format %s\n",
-mode->hdisplay, mode->vdisplay,
-drm_get_format_name(format, &tmp));
-   if (!mcde->mdsi) {
-   /* TODO: deal with this for non-DSI output */
-   dev_err(drm->dev, "no DSI master attached!\n");
-   return;
-   }
+   dev_info(mcde->dev, "output in %s mode, format %dbpp\n",
+(mcde->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO) ?
+"VIDEO" : "CMD",
+mipi_dsi_pixel_format_to_bpp(mcde->mdsi->format));
+   formatter_cpp =
+   mipi_dsi_pixel_format_to_bpp(mcde->mdsi->format) / 8;
+   dev_info(mcde->dev, "Overlay CPP: %d bytes, DSI formatter CPP %d 
bytes\n",
+cpp, formatter_cpp);
 
/* Set up the main control, watermark level at 7 */
val = 7 << MCDE_CONF0_IFIFOCTRLWTRMRKLVL_SHIFT;
-   /* 24 bits DPI: connect LSB Ch B to D[0:7] */
+
+   /*
+* This is the internal silicon muxing of the DPI
+* (parallell display) lines. Since we are not using
+* this at all (we are using DSI) these are just
+* dummy values from the vendor tree.
+*/
val |= 3 << MCDE_CONF0_OUTMUX0_SHIFT;
-   /* TV out: connect LSB Ch B to D[8:15] */
val |= 3 << MCDE_CONF0_OUTMUX1_SHIFT;
-   /* Don't care about this muxing */
val |= 0 << MCDE_CONF0_OUTMUX2_SHIFT;
-   /* 24 bits DPI: connect MID Ch B to D[24:31] */
val |= 4 << MCDE_CONF0_OUTMUX3_SHIFT;
-   /* 5: 24 bits DPI: connect MSB Ch B to D[32:39] */
val |= 5 << MCDE_CONF0_OUTMUX4_SHIFT;
-   /* Syncmux bits zero: DPI channel A and B on output pins A and B resp */
writel(val, mcde->regs + MCDE_CONF0);
 
-   /* Clear any pending interrupts */
-   mcde_display_disable_irqs(mcde);
-   writel(0, mcde->regs + MCDE_IMSCERR);
-   writel(0x, mcde->regs + MCDE_RISERR);
-
-   dev_info(drm->dev, "output in %s mode, format %dbpp\n",
-(mcde->mdsi->mode_flags & MIPI_DSI_MODE_VIDEO) ?
-"VIDEO" : "CMD",
-mipi_dsi_pixel_format_to_bpp(mcde->mdsi->format));
-   formatter_cpp =
-   mipi_dsi_pixel_format_to_bpp(mcde->mdsi->format) / 8;
-   dev_info(drm->dev, "overlay CPP %d bytes, DSI CPP %d bytes\n",
-cpp,
-formatter_cpp);
-
/* Calculations from mcde_fmtr_dsi.c, fmtr_dsi_enable_video() */
 
/*
@@ -948,9 +918,9 @@ static void mcde_display_enable(struct 
drm_simple_display_pipe *pipe,
/* The FIFO is 640 entries deep on this v3 hardware */
pkt_div = mcde_dsi_get_pkt_div(mode->hdisplay, 640);
}
-   dev_dbg(drm->dev, "FIFO watermark after flooring: %d bytes\n",
+   dev_dbg(mcde->dev, "FIFO watermark after flooring: %d bytes\n",
 

[PATCH 2/2] drm/mcde: Support DPI output

2020-11-12 Thread Linus Walleij
This implements support for DPI output using the port node
in the device tree to connect a DPI LCD display to the
MCDE. The block also supports TV-out but we leave that
for another day when we have a hardware using it.

We implement parsing and handling of the "port" node,
and follow that to the DPI endpoint.

The clock divider used by the MCDE to divide down the
"lcdclk" (this has been designed for TV-like frequencies)
is represented by an ordinary clock provider internally
in the MCDE. This idea was inspired by the PL111 solution
by Eric Anholt: the divider also works very similar to
the Pl111 clock divider.

We take care to clear up some errors regarding the number
of available formatters and their type. We have 6 DSI
formatters and 2 DPI formatters.

Tested on the Samsung GT-I9070 Janice mobile phone.

Cc: Stephan Gerhold 
Cc: phone-de...@vger.kernel.org
Cc: upstream...@lists.sr.ht
Signed-off-by: Linus Walleij 
---
 drivers/gpu/drm/mcde/Kconfig |   1 +
 drivers/gpu/drm/mcde/Makefile|   2 +-
 drivers/gpu/drm/mcde/mcde_clk_div.c  | 192 ++
 drivers/gpu/drm/mcde/mcde_display.c  | 304 ---
 drivers/gpu/drm/mcde/mcde_display_regs.h |  87 +++
 drivers/gpu/drm/mcde/mcde_drm.h  |  10 +
 drivers/gpu/drm/mcde/mcde_drv.c  |  46 +++-
 7 files changed, 595 insertions(+), 47 deletions(-)
 create mode 100644 drivers/gpu/drm/mcde/mcde_clk_div.c

diff --git a/drivers/gpu/drm/mcde/Kconfig b/drivers/gpu/drm/mcde/Kconfig
index b3990126562c..71c689b573c9 100644
--- a/drivers/gpu/drm/mcde/Kconfig
+++ b/drivers/gpu/drm/mcde/Kconfig
@@ -4,6 +4,7 @@ config DRM_MCDE
depends on CMA
depends on ARM || COMPILE_TEST
depends on OF
+   depends on COMMON_CLK
select MFD_SYSCON
select DRM_MIPI_DSI
select DRM_BRIDGE
diff --git a/drivers/gpu/drm/mcde/Makefile b/drivers/gpu/drm/mcde/Makefile
index fe28f4e0fe46..15d9c89a3273 100644
--- a/drivers/gpu/drm/mcde/Makefile
+++ b/drivers/gpu/drm/mcde/Makefile
@@ -1,3 +1,3 @@
-mcde_drm-y +=  mcde_drv.o mcde_dsi.o mcde_display.o
+mcde_drm-y +=  mcde_drv.o mcde_dsi.o mcde_clk_div.o mcde_display.o
 
 obj-$(CONFIG_DRM_MCDE) += mcde_drm.o
diff --git a/drivers/gpu/drm/mcde/mcde_clk_div.c 
b/drivers/gpu/drm/mcde/mcde_clk_div.c
new file mode 100644
index ..038821d2ef80
--- /dev/null
+++ b/drivers/gpu/drm/mcde/mcde_clk_div.c
@@ -0,0 +1,192 @@
+// SPDX-License-Identifier: GPL-2.0
+#include 
+#include 
+
+#include "mcde_drm.h"
+#include "mcde_display_regs.h"
+
+/* The MCDE internal clock dividers for FIFO A and B */
+struct mcde_clk_div {
+   struct clk_hw hw;
+   struct mcde *mcde;
+   u32 cr;
+   u32 cr_div;
+};
+
+static int mcde_clk_div_enable(struct clk_hw *hw)
+{
+   struct mcde_clk_div *cdiv = container_of(hw, struct mcde_clk_div, hw);
+   struct mcde *mcde = cdiv->mcde;
+   u32 val;
+
+   spin_lock(&mcde->fifo_crx1_lock);
+   val = readl(mcde->regs + cdiv->cr);
+   /*
+* Select the PLL72 (LCD) clock as parent
+* FIXME: implement other parents.
+*/
+   val &= ~MCDE_CRX1_CLKSEL_MASK;
+   val |= MCDE_CRX1_CLKSEL_CLKPLL72 << MCDE_CRX1_CLKSEL_SHIFT;
+   /* Internal clock */
+   val |= MCDE_CRA1_CLKTYPE_TVXCLKSEL1;
+
+   /* Clear then set the divider */
+   val &= ~(MCDE_CRX1_BCD | MCDE_CRX1_PCD_MASK);
+   val |= cdiv->cr_div;
+
+   writel(val, mcde->regs + cdiv->cr);
+   spin_unlock(&mcde->fifo_crx1_lock);
+
+   return 0;
+}
+
+static int mcde_clk_div_choose_div(struct clk_hw *hw, unsigned long rate,
+  unsigned long *prate, bool set_parent)
+{
+   int best_div = 1, div;
+   struct clk_hw *parent = clk_hw_get_parent(hw);
+   unsigned long best_prate = 0;
+   unsigned long best_diff = ~0ul;
+   int max_div = (1 << MCDE_CRX1_PCD_BITS) - 1;
+
+   for (div = 1; div < max_div; div++) {
+   unsigned long this_prate, div_rate, diff;
+
+   if (set_parent)
+   this_prate = clk_hw_round_rate(parent, rate * div);
+   else
+   this_prate = *prate;
+   div_rate = DIV_ROUND_UP_ULL(this_prate, div);
+   diff = abs(rate - div_rate);
+
+   if (diff < best_diff) {
+   best_div = div;
+   best_diff = diff;
+   best_prate = this_prate;
+   }
+   }
+
+   *prate = best_prate;
+   return best_div;
+}
+
+static long mcde_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
+unsigned long *prate)
+{
+   int div = mcde_clk_div_choose_div(hw, rate, prate, true);
+
+   return DIV_ROUND_UP_ULL(*prate, div);
+}
+
+static unsigned long mcde_clk_div_recalc_rate(struct clk_hw *hw,
+  unsigned long prate)
+{
+   struct mcde_clk_div *cdiv = container_of(

RE: [PATCH] drm/nouveau: Fix out-of-bounds access when deferencing MMU type

2020-11-12 Thread Ruhl, Michael J
>-Original Message-
>From: Ben Skeggs 
>Sent: Wednesday, November 11, 2020 9:39 PM
>To: Ruhl, Michael J 
>Cc: Thomas Zimmermann ; bske...@redhat.com;
>airl...@linux.ie; dan...@ffwll.ch; christian.koe...@amd.com; amd-
>g...@lists.freedesktop.org; nouv...@lists.freedesktop.org; dri-
>de...@lists.freedesktop.org; virtualizat...@lists.linux-foundation.org; Roland
>Scheidegger ; Jason Gunthorpe ;
>Huang Rui ; VMware Graphics maintai...@vmware.com>; Gerd Hoffmann ; spice-
>de...@lists.freedesktop.org; Alex Deucher ;
>Dave Airlie ; Likun Gao ; Felix
>Kuehling ; Hawking Zhang
>
>Subject: Re: [PATCH] drm/nouveau: Fix out-of-bounds access when
>deferencing MMU type
>
>On Thu, 12 Nov 2020 at 02:27, Ruhl, Michael J 
>wrote:
>>
>> >-Original Message-
>> >From: Thomas Zimmermann 
>> >Sent: Wednesday, November 11, 2020 7:08 AM
>> >To: Ruhl, Michael J ; bske...@redhat.com;
>> >airl...@linux.ie; dan...@ffwll.ch; christian.koe...@amd.com
>> >Cc: nouv...@lists.freedesktop.org; dri-devel@lists.freedesktop.org;
>> >Maarten Lankhorst ; Maxime Ripard
>> >; Dave Airlie ; Gerd Hoffmann
>> >; Alex Deucher ;
>> >VMware Graphics ; Roland
>> >Scheidegger ; Huang Rui ;
>> >Felix Kuehling ; Hawking Zhang
>> >; Jason Gunthorpe ; Likun
>Gao
>> >; virtualizat...@lists.linux-foundation.org; spice-
>> >de...@lists.freedesktop.org; amd-...@lists.freedesktop.org
>> >Subject: Re: [PATCH] drm/nouveau: Fix out-of-bounds access when
>> >deferencing MMU type
>> >
>> >Hi
>> >
>> >Am 10.11.20 um 16:27 schrieb Ruhl, Michael J:
>> >>
>> >>
>> >>> -Original Message-
>> >>> From: Thomas Zimmermann 
>> >>> Sent: Tuesday, November 10, 2020 8:37 AM
>> >>> To: bske...@redhat.com; airl...@linux.ie; dan...@ffwll.ch; Ruhl,
>Michael J
>> >>> ; christian.koe...@amd.com
>> >>> Cc: nouv...@lists.freedesktop.org; dri-devel@lists.freedesktop.org;
>> >Thomas
>> >>> Zimmermann ; Maarten Lankhorst
>> >>> ; Maxime Ripard
>> >>> ; Dave Airlie ; Gerd
>Hoffmann
>> >>> ; Alex Deucher ;
>> >>> VMware Graphics ; Roland
>> >>> Scheidegger ; Huang Rui
>;
>> >>> Felix Kuehling ; Hawking Zhang
>> >>> ; Jason Gunthorpe ; Likun
>> >Gao
>> >>> ; virtualizat...@lists.linux-foundation.org;
>spice-
>> >>> de...@lists.freedesktop.org; amd-...@lists.freedesktop.org
>> >>> Subject: [PATCH] drm/nouveau: Fix out-of-bounds access when
>> >deferencing
>> >>> MMU type
>> >>>
>> >>> The value of struct drm_device.ttm.type_vram can become -1 for
>> >unknown
>> >>> types of memory (see nouveau_ttm_init()). This leads to an out-of-
>bounds
>> >>> error when accessing struct nvif_mmu.type[]:
>> >>
>> >> Would this make more sense to just set the type_vram = 0 instead of -1?
>> >
>> >From what I understand, these indices refer to an internal type of MMU,
>> >rsp the MMU's capabilities. However, my hardware (pre-NV50) does not
>> >have an MMU at all.
>>
>> Yeah, and upon further review I see that my comment was completely
>wrong
>> (value vs. index).
>>
>> A better suggestion would have been, create an entry in the array that
>means,
>> "unsupported type" with a value of 0, but...
>>
>> >I agree that it would be nice to have a cleaner design that incorporates
>> >this case, but resolving that would apparently require more than a bugfix.
>>
>> I agree.  The -1 index is a special case for the platform path
>> (platform != NV_DEVICE_INFO_V0_SOC).  This is a fix for the issue, but not
>> a complete solution.
>>
>> If you need it:
>> Reviewed-by: Michael J. Ruhl 
>I've put an alternate fix for this here[1], and will get it into
>drm-fixes later today.
>
>Ben.
>
>[1]
>https://github.com/skeggsb/nouveau/commit/4590f7120c2f1f4aea9d8b93a2d
>ae43b312d35ad

This makes a lot of sense.  I spent some time trying to reconcile the platform 
info
that was not being used in this case, but didn't see the solution like this.   
This is
pretty clean.

If you would like:

Reviewed-by: Michael J. Ruhl 

For this solution as well.

Mike

>>
>> Thanks,
>> Mike
>>
>> >Best regards
>> >Thomas
>> >
>> >>
>> >> Mike
>> >>
>> >>>
>> >>>  [   18.304116]
>> >>>
>>
>>==
>=
>> >>> ===
>> >>>  [   18.311649] BUG: KASAN: slab-out-of-bounds in
>> >>> nouveau_ttm_io_mem_reserve+0x17a/0x7e0 [nouveau]
>> >>>  [   18.320415] Read of size 1 at addr 88810ffac1fe by task systemd-
>> >>> udevd/342
>> >>>  [   18.327681]
>> >>>  [   18.329208] CPU: 1 PID: 342 Comm: systemd-udevd Tainted: G   
>> >>>  E
>> >>> 5.10.0-rc2-1-default+ #581
>> >>>  [   18.338681] Hardware name: Dell Inc. OptiPlex 9020/0N4YC8, BIOS A24
>> >>> 10/24/2018
>> >>>  [   18.346032] Call Trace:
>> >>>  [   18.348536]  dump_stack+0xae/0xe5
>> >>>  [   18.351919]  print_address_description.constprop.0+0x17/0xf0
>> >>>  [   18.357787]  ? nouveau_ttm_io_mem_reserve+0x17a/0x7e0
>[nouveau]
>> >>>  [   18.363818]  __kasan_report.cold+0x20/0x38
>> >>>  [   18.368099]  ? nouveau_ttm_io_mem_reserve+0x17a/0x7e0
>[nouveau]
>> >>>  [   18.374133]  kasan_report+0x3a/0x50
>> >>>  [   18.377789]  

[PATCH v9 1/5] dt-bindings: devfreq: Add documentation for the interconnect properties

2020-11-12 Thread Sylwester Nawrocki
Add documentation for new optional properties in the exynos bus nodes:
interconnects, #interconnect-cells, samsung,data-clock-ratio.
These properties allow to specify the SoC interconnect structure which
then allows the interconnect consumer devices to request specific
bandwidth requirements.

Acked-by: Krzysztof Kozlowski 
Acked-by: Chanwoo Choi 
Tested-by: Chanwoo Choi 
Acked-by: Rob Herring 
Signed-off-by: Artur Świgoń 
Signed-off-by: Sylwester Nawrocki 
---
Changes for v9:
 - added Ack tags

Changes for v8:
 - updated description of the interconnects property,
 - fixed typo in samsung,data-clk-ratio property description.

Changes for v7:
 - bus-width property replaced with samsung,data-clock-ratio,
 - the interconnect consumer bindings used instead of vendor specific
   properties

Changes for v6:
 - added dts example of bus hierarchy definition and the interconnect
   consumer,
 - added new bus-width property.

Changes for v5:
 - exynos,interconnect-parent-node renamed to samsung,interconnect-parent
---
 .../devicetree/bindings/devfreq/exynos-bus.txt | 71 +-
 1 file changed, 69 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt 
b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt
index e71f752..bcaa2c0 100644
--- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt
+++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt
@@ -51,6 +51,19 @@ Optional properties only for parent bus device:
 - exynos,saturation-ratio: the percentage value which is used to calibrate
the performance count against total cycle count.
 
+Optional properties for the interconnect functionality (QoS frequency
+constraints):
+- #interconnect-cells: should be 0.
+- interconnects: as documented in ../interconnect.txt, describes a path at the
+  higher level interconnects used by this interconnect provider.
+  If this interconnect provider is directly linked to a top level interconnect
+  provider the property contains only one phandle. The provider extends
+  the interconnect graph by linking its node to a node registered by provider
+  pointed to by first phandle in the 'interconnects' property.
+
+- samsung,data-clock-ratio: ratio of the data throughput in B/s to minimum data
+   clock frequency in Hz, default value is 8 when this property is missing.
+
 Detailed correlation between sub-blocks and power line according to Exynos SoC:
 - In case of Exynos3250, there are two power line as following:
VDD_MIF |--- DMC
@@ -135,7 +148,7 @@ Detailed correlation between sub-blocks and power line 
according to Exynos SoC:
|--- PERIC (Fixed clock rate)
|--- FSYS  (Fixed clock rate)
 
-Example1:
+Example 1:
Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to
power line (regulator). The MIF (Memory Interface) AXI bus is used to
transfer data between DRAM and CPU and uses the VDD_MIF regulator.
@@ -184,7 +197,7 @@ Example1:
|L5   |20 |20  |40 |30 |   ||100 |
--
 
-Example2 :
+Example 2:
The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi
is listed below:
 
@@ -419,3 +432,57 @@ Example2 :
devfreq = <&bus_leftbus>;
status = "okay";
};
+
+Example 3:
+   An interconnect path "bus_display -- bus_leftbus -- bus_dmc" on
+   Exynos4412 SoC with video mixer as an interconnect consumer device.
+
+   soc {
+   bus_dmc: bus_dmc {
+   compatible = "samsung,exynos-bus";
+   clocks = <&clock CLK_DIV_DMC>;
+   clock-names = "bus";
+   operating-points-v2 = <&bus_dmc_opp_table>;
+   samsung,data-clock-ratio = <4>;
+   #interconnect-cells = <0>;
+   };
+
+   bus_leftbus: bus_leftbus {
+   compatible = "samsung,exynos-bus";
+   clocks = <&clock CLK_DIV_GDL>;
+   clock-names = "bus";
+   operating-points-v2 = <&bus_leftbus_opp_table>;
+   #interconnect-cells = <0>;
+   interconnects = <&bus_dmc>;
+   };
+
+   bus_display: bus_display {
+   compatible = "samsung,exynos-bus";
+   clocks = <&clock CLK_ACLK160>;
+   clock-names = "bus";
+   operating-points-v2 = <&bus_display_opp_table>;
+   #interconnect-cells = <0>;
+   interconnects = <&bus_leftbus &bus_dmc>;
+   };
+
+   bus_dmc_opp_table: opp_table1 {
+   compatible = "operating-points-v2";
+   /* ... */
+   }
+
+   bus_leftbus_opp_table: opp_

[PATCH v9 4/5] PM / devfreq: exynos-bus: Add registration of interconnect child device

2020-11-12 Thread Sylwester Nawrocki
This patch adds registration of a child platform device for the exynos
interconnect driver. It is assumed that the interconnect provider will
only be needed when #interconnect-cells property is present in the bus
DT node, hence the child device will be created only when such a property
is present.

Acked-by: Krzysztof Kozlowski 
Acked-by: Chanwoo Choi 
Signed-off-by: Sylwester Nawrocki 
---
Changes for v9:
 - whitespace (indentation) corrections.

Changes for v8...v6:
 - none.

Changes for v5:
 - new patch.
---
 drivers/devfreq/exynos-bus.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 1e684a4..20447a4 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -24,6 +24,7 @@
 
 struct exynos_bus {
struct device *dev;
+   struct platform_device *icc_pdev;
 
struct devfreq *devfreq;
struct devfreq_event_dev **edev;
@@ -156,6 +157,8 @@ static void exynos_bus_exit(struct device *dev)
if (ret < 0)
dev_warn(dev, "failed to disable the devfreq-event devices\n");
 
+   platform_device_unregister(bus->icc_pdev);
+
dev_pm_opp_of_remove_table(dev);
clk_disable_unprepare(bus->clk);
if (bus->opp_table) {
@@ -168,6 +171,8 @@ static void exynos_bus_passive_exit(struct device *dev)
 {
struct exynos_bus *bus = dev_get_drvdata(dev);
 
+   platform_device_unregister(bus->icc_pdev);
+
dev_pm_opp_of_remove_table(dev);
clk_disable_unprepare(bus->clk);
 }
@@ -432,6 +437,18 @@ static int exynos_bus_probe(struct platform_device *pdev)
if (ret < 0)
goto err;
 
+   /* Create child platform device for the interconnect provider */
+   if (of_get_property(dev->of_node, "#interconnect-cells", NULL)) {
+   bus->icc_pdev = platform_device_register_data(
+   dev, "exynos-generic-icc",
+   PLATFORM_DEVID_AUTO, NULL, 0);
+
+   if (IS_ERR(bus->icc_pdev)) {
+   ret = PTR_ERR(bus->icc_pdev);
+   goto err;
+   }
+   }
+
max_state = bus->devfreq->profile->max_state;
min_freq = (bus->devfreq->profile->freq_table[0] / 1000);
max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v9 2/5] interconnect: Add generic interconnect driver for Exynos SoCs

2020-11-12 Thread Sylwester Nawrocki
This patch adds a generic interconnect driver for Exynos SoCs in order
to provide interconnect functionality for each "samsung,exynos-bus"
compatible device.

The SoC topology is a graph (or more specifically, a tree) and its
edges are described by specifying in the 'interconnects' property
the interconnect consumer path for each interconnect provider DT node.

Each bus is now an interconnect provider and an interconnect node as
well (cf. Documentation/interconnect/interconnect.rst), i.e. every bus
registers itself as a node. Node IDs are not hard coded but rather
assigned dynamically at runtime. This approach allows for using this
driver with various Exynos SoCs.

Frequencies requested via the interconnect API for a given node are
propagated to devfreq using dev_pm_qos_update_request(). Please note
that it is not an error when CONFIG_INTERCONNECT is 'n', in which
case all interconnect API functions are no-op.

The samsung,data-clk-ratio DT property is used to specify the ratio
of the interconect bandwidth to the minimum data clock frequency
for each bus.

Due to unspecified relative probing order, -EPROBE_DEFER may be
propagated to ensure that the parent is probed before its children.

Reviewed-by: Chanwoo Choi 
Tested-by: Chanwoo Choi 
Acked-by: Krzysztof Kozlowski 
Signed-off-by: Artur Świgoń 
Signed-off-by: Sylwester Nawrocki 
---
Changes for v9:
 - Makefile and Kconfig fixes/improvements.

Changes for v8:
 - renamed drivers/interconnect/exynos to drivers/interconnect/samsung,
 - added missing driver sync_state callback assignment.

Changes for v7:
 - adjusted to the DT property changes: "interconnects" instead
   of "samsung,interconnect-parent", "samsung,data-clk-ratio"
   instead of "bus-width",
 - adaptation to of_icc_get_from_provider() function changes
   in v5.10-rc1.

Changes for v6:
 - corrected of_node dereferencing in exynos_icc_get_parent()
   function,
 - corrected initialization of icc_node->name so as to avoid
   direct of_node->name dereferencing,
 - added parsing of bus-width DT property.

Changes for v5:
 - adjust to renamed exynos,interconnect-parent-node property,
 - use automatically generated platform device id as the interconect
   node id instead of a now unavailable devfreq->id field,
 - add icc_ prefix to some variables to make the code more self-commenting,
 - use icc_nodes_remove() instead of icc_node_del() + icc_node_destroy(),
 - adjust to exynos,interconnect-parent-node property rename to
   samsung,interconnect-parent,
 - converted to a separate platform driver in drivers/interconnect.
---
 drivers/interconnect/Kconfig  |   1 +
 drivers/interconnect/Makefile |   1 +
 drivers/interconnect/samsung/Kconfig  |  13 +++
 drivers/interconnect/samsung/Makefile |   4 +
 drivers/interconnect/samsung/exynos.c | 199 ++
 5 files changed, 218 insertions(+)
 create mode 100644 drivers/interconnect/samsung/Kconfig
 create mode 100644 drivers/interconnect/samsung/Makefile
 create mode 100644 drivers/interconnect/samsung/exynos.c

diff --git a/drivers/interconnect/Kconfig b/drivers/interconnect/Kconfig
index 5b7204e..d637a89 100644
--- a/drivers/interconnect/Kconfig
+++ b/drivers/interconnect/Kconfig
@@ -13,5 +13,6 @@ if INTERCONNECT
 
 source "drivers/interconnect/imx/Kconfig"
 source "drivers/interconnect/qcom/Kconfig"
+source "drivers/interconnect/samsung/Kconfig"
 
 endif
diff --git a/drivers/interconnect/Makefile b/drivers/interconnect/Makefile
index d203520..97d393f 100644
--- a/drivers/interconnect/Makefile
+++ b/drivers/interconnect/Makefile
@@ -6,3 +6,4 @@ icc-core-objs   := core.o bulk.o
 obj-$(CONFIG_INTERCONNECT) += icc-core.o
 obj-$(CONFIG_INTERCONNECT_IMX) += imx/
 obj-$(CONFIG_INTERCONNECT_QCOM)+= qcom/
+obj-$(CONFIG_INTERCONNECT_SAMSUNG) += samsung/
diff --git a/drivers/interconnect/samsung/Kconfig 
b/drivers/interconnect/samsung/Kconfig
new file mode 100644
index 000..6820e4f
--- /dev/null
+++ b/drivers/interconnect/samsung/Kconfig
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config INTERCONNECT_SAMSUNG
+   bool "Samsung SoC interconnect drivers"
+   depends on ARCH_EXYNOS || COMPILE_TEST
+   help
+ Interconnect drivers for Samsung SoCs.
+
+config INTERCONNECT_EXYNOS
+   tristate "Exynos generic interconnect driver"
+   depends on INTERCONNECT_SAMSUNG
+   default y if ARCH_EXYNOS
+   help
+ Generic interconnect driver for Exynos SoCs.
diff --git a/drivers/interconnect/samsung/Makefile 
b/drivers/interconnect/samsung/Makefile
new file mode 100644
index 000..e19d1df
--- /dev/null
+++ b/drivers/interconnect/samsung/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+exynos-interconnect-objs   := exynos.o
+
+obj-$(CONFIG_INTERCONNECT_EXYNOS)  += exynos-interconnect.o
diff --git a/drivers/interconnect/samsung/exynos.c 
b/drivers/interconnect/samsung/exynos.c
new file mode 1006

[PATCH v9 3/5] MAINTAINERS: Add entry for Samsung interconnect drivers

2020-11-12 Thread Sylwester Nawrocki
Add maintainers entry for the Samsung SoC interconnect drivers, this
currently includes the Exynos generic interconnect driver.

Reviewed-by: Chanwoo Choi 
Signed-off-by: Sylwester Nawrocki 
---
Changes for v9:
 - add linux-samsung-soc ML,
 - fixed Artur's last name spelling,
 - whole entry moved to maintain alphabetical order,
 - added missing traling '/' to directory path.

Changes since v7:
 - new patch.
---
 MAINTAINERS | 8 
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index e73636b..1d8246c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15400,6 +15400,14 @@ L: linux-fb...@vger.kernel.org
 S: Maintained
 F: drivers/video/fbdev/s3c-fb.c
 
+SAMSUNG INTERCONNECT DRIVERS
+M: Sylwester Nawrocki 
+M: Artur Świgoń 
+L: linux...@vger.kernel.org
+L: linux-samsung-...@vger.kernel.org
+S: Supported
+F: drivers/interconnect/samsung/
+
 SAMSUNG LAPTOP DRIVER
 M: Corentin Chary 
 L: platform-driver-...@vger.kernel.org
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v9 5/5] drm: exynos: mixer: Add interconnect support

2020-11-12 Thread Sylwester Nawrocki
This patch adds interconnect support to exynos-mixer. The mixer works
the same as before when CONFIG_INTERCONNECT is 'n'.

For proper operation of the video mixer block we need to ensure the
interconnect busses like DMC or LEFTBUS provide enough bandwidth so
as to avoid DMA buffer underruns in the mixer block. I.e we need to
prevent those busses from operating in low perfomance OPPs when
the mixer is running.
In this patch the bus bandwidth request is done through the interconnect
API, the bandwidth value is calculated from selected DRM mode, i.e.
video plane width, height, refresh rate and pixel format.

The bandwidth setting is synchronized with VSYNC when we are switching
to lower bandwidth. This is required to ensure enough bandwidth for
the device since new settings are normally being applied in the hardware
synchronously with VSYNC.

Acked-by: Krzysztof Kozlowski 
Reviewed-by: Chanwoo Choi 
Tested-by: Chanwoo Choi 
Co-developed-by: Artur Świgoń 
Signed-off-by: Artur Świgoń 
Co-developed-by: Marek Szyprowski 
Signed-off-by: Marek Szyprowski 
Signed-off-by: Sylwester Nawrocki 
---
Changes for v9:
 - whitespace cleanup,
 - Co-developed-by/Signed-off-by tags corrections.

Changes for v8:
 - updated comment in mixer_probe()

Changes for v7:
 - fixed incorrect setting of the ICC bandwidth when the mixer is
   disabled, now the bandwidth is set explicitly to 0 in such case.

Changes for v6:
 - the icc_set_bw() call is now only done when calculated value for
   a crtc changes, this avoids unnecessary calls per each video frame
 - added synchronization of the interconnect bandwidth setting with
   the mixer VSYNC in order to avoid buffer underflow when we lower
   the interconnect bandwidth when the hardware still operates with
   previous mode settings that require higher bandwidth. This fixed
   IOMMU faults observed e.g. during switching from two planes to
   a single plane operation.

Changes for v5:
 - renamed soc_path variable to icc_path
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 146 --
 1 file changed, 138 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index af192e5..502ce04 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -73,6 +74,7 @@ enum mixer_flag_bits {
MXR_BIT_INTERLACE,
MXR_BIT_VP_ENABLED,
MXR_BIT_HAS_SCLK,
+   MXR_BIT_REQUEST_BW,
 };
 
 static const uint32_t mixer_formats[] = {
@@ -99,6 +101,13 @@ struct mixer_context {
struct exynos_drm_plane planes[MIXER_WIN_NR];
unsigned long   flags;
 
+   struct icc_path *icc_path;
+   /* memory bandwidth on the interconnect bus in B/s */
+   unsigned long   icc_bandwidth;
+   /* mutex protecting @icc_bandwidth */
+   struct mutexicc_lock;
+   struct work_struct  work;
+
int irq;
void __iomem*mixer_regs;
void __iomem*vp_regs;
@@ -754,6 +763,9 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg)
val |= MXR_INT_CLEAR_VSYNC;
val &= ~MXR_INT_STATUS_VSYNC;
 
+   if (test_and_clear_bit(MXR_BIT_REQUEST_BW, &ctx->flags))
+   schedule_work(&ctx->work);
+
/* interlace scan need to check shadow register */
if (test_bit(MXR_BIT_INTERLACE, &ctx->flags)
&& !mixer_is_synced(ctx))
@@ -934,6 +946,76 @@ static void mixer_disable_vblank(struct exynos_drm_crtc 
*crtc)
mixer_reg_writemask(mixer_ctx, MXR_INT_EN, 0, MXR_INT_EN_VSYNC);
 }
 
+/**
+ * mixer_get_memory_bandwidth - calculate memory bandwidth for current crtc 
mode
+ * @crtc: a crtc with DRM mode to calculate the bandwidth for
+ *
+ * Return: memory bandwidth in B/s
+ *
+ * This function returns memory bandwidth calculated as a sum of amount of data
+ * per second for each plane. The calculation is based on maximum possible 
pixel
+ * resolution for a plane so as to avoid different bandwidth request per each
+ * video frame. The formula used for calculation for each plane is:
+ *
+ * bw = width * height * frame_rate / interlace / (hor_subs * vert_subs)
+ *
+ * where:
+ *  - width, height - (DRM mode) video frame width and height in pixels,
+ *  - frame_rate - DRM mode frame refresh rate,
+ *  - interlace: 1 - in case of progressive and 2 in case of interlaced video,
+ *  - hor_subs, vert_subs - accordingly horizontal and vertical pixel
+ *subsampling for a plane.
+ */
+static unsigned int mixer_get_memory_bandwidth(struct exynos_drm_crtc *crtc)
+{
+   struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
+   struct mixer_context *ctx = crtc->ctx;
+   unsigned long bw, bandwidth = 0;
+   int i, j, sub;
+
+   for (i = 0; i < MIXER_

[PATCH v9 0/5] Exynos: Simple QoS for exynos-bus using interconnect

2020-11-12 Thread Sylwester Nawrocki


This patchset adds interconnect API support for the Exynos SoC "samsung,
exynos-bus" compatible devices, which already have their corresponding
exynos-bus driver in the devfreq subsystem.  Complementing the devfreq
driver with an interconnect functionality allows to ensure the QoS
requirements of devices accessing the system memory (e.g. video processing
devices) are fulfilled and allows to avoid issues like the one discussed
in thread [1].

This patch series adds implementation of the interconnect provider per each
"samsung,exynos-bus" compatible DT node, with one interconnect node per
provider.  The interconnect code which was previously added as a part of
the devfreq driver has been converted to a separate platform driver.
In the devfreq a corresponding virtual child platform device is registered.
Integration of devfreq and interconnect frameworks is achieved through
the PM QoS API.

A sample interconnect consumer for exynos-mixer is added in patch 5/5,
it is currently added only for exynos4412 and allows to address the
mixer DMA underrun error issues [1].

Changes since v8:
 - excluded from the series already applied dts patches, 
 - Co-developed-by/Signed-off-by tag corrections, Ack tags added,
 - the maintainers entry corrections adressing review comments,
 - Kconfig/Makefile improvements/corrections,
 - whitespace/indentation cleanup.

The series has been tested on Odroid U3 board. It is based on v5.10-rc1.

--
Regards,
Sylwester

Changes since v7:
 - drivers/interconnect/exynos renamed to drivers/interconnect/samsung,
 - added INTERCONNECT_SAMSUNG Kconfig symbol,
 - added missing driver sync_state callback,
 - improved the DT binding description,
 - added a patch adding maintainers entry,
 - updated comment in patch 7/7, typo fix (patch 1/7).

Changes since v6:
 - the interconnect consumer DT bindings are now used to describe dependencies
   of the interconnects (samsung,exynos-bus nodes),
 - bus-width property replaced with samsung,data-clk-ratio,
 - adaptation to recent changes in the interconnect code
   (of_icc_get_from_provider(), icc_node_add()).

Changes since v5:
 - addition of "bus-width: DT property, which specifies data width
   of the interconnect bus (patches 1...2/6),
 - addition of synchronization of the interconnect bandwidth setting
   with VSYNC (patch 6/6).

Changes since v3 [4] (v4 skipped to align with patchset [1]), detailed
changes are listed in patches:
 - conversion to a separate interconnect (platform) driver,
 - an update of the DT binding documenting new optional properties:
   #interconnect-cells, samsung,interconnect-parent in "samsung,exynos-bus"
   nodes,
 - new DT properties added to the SoC, rather than to the board specific
   files.

Changes since v2 [5]:
 - Use icc_std_aggregate().
 - Implement a different modification of apply_constraints() in
   drivers/interconnect/core.c (patch 03).
 - Use 'exynos,interconnect-parent-node' in the DT instead of
   'devfreq'/'parent', depending on the bus.
 - Rebase on DT patches that deprecate the 'devfreq' DT property.
 - Improve error handling, including freeing generated IDs on failure.
 - Remove exynos_bus_icc_connect() and add exynos_bus_icc_get_parent().

Changes since v1 [6]:
 - Rebase on coupled regulators patches.
 - Use dev_pm_qos_*() API instead of overriding frequency in
   exynos_bus_target().
 - Use IDR for node ID allocation.
 - Reverse order of multiplication and division in
   mixer_set_memory_bandwidth() (patch 07) to avoid integer overflow.


References:
[1] https://patchwork.kernel.org/patch/10861757/ (original issue)
[2] https://www.spinics.net/lists/linux-samsung-soc/msg70014.html
[3] https://www.spinics.net/lists/arm-kernel/msg810722.html
[4] https://lore.kernel.org/linux-pm/20191220115653.6487-1-a.swi...@samsung.com
[5] https://patchwork.kernel.org/cover/11054417/ (v1 of this RFC)
[6] https://patchwork.kernel.org/cover/11152595/ (v2 of this RFC)


Sylwester Nawrocki (5):
  dt-bindings: devfreq: Add documentation for the interconnect
properties
  interconnect: Add generic interconnect driver for Exynos SoCs
  MAINTAINERS: Add entry for Samsung interconnect drivers
  PM / devfreq: exynos-bus: Add registration of interconnect child
device
  drm: exynos: mixer: Add interconnect support

 .../devicetree/bindings/devfreq/exynos-bus.txt |  71 +++-
 MAINTAINERS|   8 +
 drivers/devfreq/exynos-bus.c   |  17 ++
 drivers/gpu/drm/exynos/exynos_mixer.c  | 146 ++-
 drivers/interconnect/Kconfig   |   1 +
 drivers/interconnect/Makefile  |   1 +
 drivers/interconnect/samsung/Kconfig   |  13 ++
 drivers/interconnect/samsung/Makefile  |   4 +
 drivers/interconnect/samsung/exynos.c  | 199 +
 9 files changed, 450 insertions(+), 10 deletions(-)
 create mode 100644 drivers/interconnect/samsung/Kconfig
 create mode 100644 drivers/in

[PATCH 1/7] drm/fb-helper: Set framebuffer for vga-switcheroo clients

2020-11-12 Thread Thomas Zimmermann
Set the framebuffer info for devices that support vga switcheroo. For
other devices, this does nothing.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/drm_fb_helper.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 01ba1da28511..d2ba404a23b3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -33,8 +33,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1940,6 +1942,8 @@ EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
 void drm_fb_helper_lastclose(struct drm_device *dev)
 {
drm_fb_helper_restore_fbdev_mode_unlocked(dev->fb_helper);
+
+   vga_switcheroo_process_delayed_switch();
 }
 EXPORT_SYMBOL(drm_fb_helper_lastclose);
 
@@ -2311,6 +2315,10 @@ static int drm_fb_helper_generic_probe(struct 
drm_fb_helper *fb_helper,
 #endif
}
 
+   /* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */
+   if (dev_is_pci(dev->dev))
+   vga_switcheroo_client_fb_set(to_pci_dev(dev->dev), fbi);
+
return 0;
 }
 
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/7] drm/radeon: Pin buffers while they are vmap'ed

2020-11-12 Thread Thomas Zimmermann
In order to avoid eviction of vmap'ed buffers, pin them in their GEM
object's vmap implementation. Unpin them in the vunmap implementation.
This is needed to make generic fbdev support work reliably. Without,
the buffer object could be evicted while fbdev flushed its shadow buffer.

In difference to the PRIME pin/unpin functions, the vmap code does not
modify the BOs prime_shared_count, so a vmap-pinned BO does not count as
shared.

The actual pin location is not important as the vmap call returns
information on how to access the buffer. Callers that require a
specific location should explicitly pin the BO before vmapping it.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/radeon/radeon_gem.c | 51 +++--
 1 file changed, 49 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
b/drivers/gpu/drm/radeon/radeon_gem.c
index d2876ce3bc9e..eaf7fc9a7b07 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -226,6 +226,53 @@ static int radeon_gem_handle_lockup(struct radeon_device 
*rdev, int r)
return r;
 }
 
+static int radeon_gem_object_vmap(struct drm_gem_object *obj, struct 
dma_buf_map *map)
+{
+   static const uint32_t any_domain = RADEON_GEM_DOMAIN_VRAM |
+  RADEON_GEM_DOMAIN_GTT |
+  RADEON_GEM_DOMAIN_CPU;
+
+   struct radeon_bo *bo = gem_to_radeon_bo(obj);
+   int ret;
+
+   ret = radeon_bo_reserve(bo, false);
+   if (ret)
+   return ret;
+
+   /* pin buffer at its current location */
+   ret = radeon_bo_pin(bo, any_domain, NULL);
+   if (ret)
+   goto err_radeon_bo_unreserve;
+
+   ret = drm_gem_ttm_vmap(obj, map);
+   if (ret)
+   goto err_radeon_bo_unpin;
+
+   radeon_bo_unreserve(bo);
+
+   return 0;
+
+err_radeon_bo_unpin:
+   radeon_bo_unpin(bo);
+err_radeon_bo_unreserve:
+   radeon_bo_unreserve(bo);
+   return ret;
+}
+
+static void radeon_gem_object_vunmap(struct drm_gem_object *obj, struct 
dma_buf_map *map)
+{
+   struct radeon_bo *bo = gem_to_radeon_bo(obj);
+   int ret;
+
+   ret = radeon_bo_reserve(bo, false);
+   if (ret)
+   return;
+
+   drm_gem_ttm_vunmap(obj, map);
+   radeon_bo_unpin(bo);
+   radeon_bo_unreserve(bo);
+}
+
 static const struct drm_gem_object_funcs radeon_gem_object_funcs = {
.free = radeon_gem_object_free,
.open = radeon_gem_object_open,
@@ -234,8 +281,8 @@ static const struct drm_gem_object_funcs 
radeon_gem_object_funcs = {
.pin = radeon_gem_prime_pin,
.unpin = radeon_gem_prime_unpin,
.get_sg_table = radeon_gem_prime_get_sg_table,
-   .vmap = drm_gem_ttm_vmap,
-   .vunmap = drm_gem_ttm_vunmap,
+   .vmap = radeon_gem_object_vmap,
+   .vunmap = radeon_gem_object_vunmap,
 };
 
 /*
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/7] drm/radeon: Whitespace fixes

2020-11-12 Thread Thomas Zimmermann
Fixed to match kernel coding style.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/radeon/radeon_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c 
b/drivers/gpu/drm/radeon/radeon_kms.c
index abb3bdd9ca25..75b038740ea8 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -74,7 +74,7 @@ void radeon_driver_unload_kms(struct drm_device *dev)
}
 
radeon_acpi_fini(rdev);
-   
+
radeon_modeset_fini(rdev);
radeon_device_fini(rdev);
 
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 0/7] drm/radeon: Convert to generic fbdev emulation

2020-11-12 Thread Thomas Zimmermann
This patchset replaces radeon's framebuffer emulation with the generic
code from fb helpers. This reduces the driver size and complexity. As
a nice side effect, it also reduces memory pressure on low-memory devices.

Patches #1 and #2 add features to fbdev emulation to bring it on par with
radeons code.

Patch #4 adds internal pinning to vmap operations. This guarantess that
the framebuffer BO is not relocated while being updated.

Patch #5 and #6 replace radeon's framebuffer code with the generic helper
with shadow buffering. All userspace mappings interact with the shadow
buffer and the BO can be relocated an necessary. This allows to enable
32-bit colors on low-memory devices.

Patches #3 and #7 are merely cleanups.

Smoke tested with an AMD R5 (Oland) card by running the console and
switching to/from Xorg and weston.

Thomas Zimmermann (7):
  drm/fb-helper: Set framebuffer for vga-switcheroo clients
  drm/fb-helper: Add hint to enable VT switching during suspend/resume
  drm/radeon: Whitespace fixes
  drm/radeon: Pin buffers while they are vmap'ed
  drm/radeon: Replace framebuffer console with generic implementation
  drm/radeon: Use fbdev shadow fb
  drm/radeon: Move radeon_align_pitch() next to its only caller

 drivers/gpu/drm/drm_fb_helper.c |  16 +-
 drivers/gpu/drm/radeon/radeon_device.c  |  11 +-
 drivers/gpu/drm/radeon/radeon_display.c |   2 -
 drivers/gpu/drm/radeon/radeon_drv.c |   5 +-
 drivers/gpu/drm/radeon/radeon_fb.c  | 366 +---
 drivers/gpu/drm/radeon/radeon_gem.c |  77 -
 drivers/gpu/drm/radeon/radeon_kms.c |  14 +-
 drivers/gpu/drm/radeon/radeon_mode.h|  10 +-
 include/drm/drm_mode_config.h   |   7 +
 9 files changed, 111 insertions(+), 397 deletions(-)

--
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 5/7] drm/radeon: Replace framebuffer console with generic implementation

2020-11-12 Thread Thomas Zimmermann
The fbdev code in radeon can be replaced by the generic fbdev helpers.
This allows for using fbdev shadow buffers and IGT testcases.

Generic fbdev acts like a regular DRM client and has to be initialized
after registering the DRM device. Change the driver initialization
accordingly. The release happens automatically during shutdown.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/radeon/radeon_display.c |   2 -
 drivers/gpu/drm/radeon/radeon_drv.c |   5 +-
 drivers/gpu/drm/radeon/radeon_fb.c  | 337 +---
 drivers/gpu/drm/radeon/radeon_kms.c |  12 -
 drivers/gpu/drm/radeon/radeon_mode.h|   7 +-
 5 files changed, 16 insertions(+), 347 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
b/drivers/gpu/drm/radeon/radeon_display.c
index b79686cf8bdb..a7bae33636c3 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1638,7 +1638,6 @@ int radeon_modeset_init(struct radeon_device *rdev)
/* setup afmt */
radeon_afmt_init(rdev);
 
-   radeon_fbdev_init(rdev);
drm_kms_helper_poll_init(rdev->ddev);
 
/* do pm late init */
@@ -1653,7 +1652,6 @@ void radeon_modeset_fini(struct radeon_device *rdev)
drm_kms_helper_poll_fini(rdev->ddev);
radeon_hpd_fini(rdev);
drm_helper_force_disable_all(rdev->ddev);
-   radeon_fbdev_fini(rdev);
radeon_afmt_fini(rdev);
drm_mode_config_cleanup(rdev->ddev);
rdev->mode_info.mode_config_initialized = false;
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c 
b/drivers/gpu/drm/radeon/radeon_drv.c
index bfadb799d6a3..63c3bf1a3a3c 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -114,7 +114,6 @@
 #define KMS_DRIVER_PATCHLEVEL  0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 void radeon_driver_unload_kms(struct drm_device *dev);
-void radeon_driver_lastclose_kms(struct drm_device *dev);
 int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv);
 void radeon_driver_postclose_kms(struct drm_device *dev,
 struct drm_file *file_priv);
@@ -374,6 +373,8 @@ static int radeon_pci_probe(struct pci_dev *pdev,
if (ret)
goto err_agp;
 
+   radeon_fbdev_init(dev->dev_private);
+
return 0;
 
 err_agp:
@@ -635,7 +636,7 @@ static const struct drm_driver kms_driver = {
.load = radeon_driver_load_kms,
.open = radeon_driver_open_kms,
.postclose = radeon_driver_postclose_kms,
-   .lastclose = radeon_driver_lastclose_kms,
+   .lastclose = drm_fb_helper_lastclose,
.unload = radeon_driver_unload_kms,
.irq_preinstall = radeon_driver_irq_preinstall_kms,
.irq_postinstall = radeon_driver_irq_postinstall_kms,
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c 
b/drivers/gpu/drm/radeon/radeon_fb.c
index fc4212633bdf..50fdc2aaa463 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -24,66 +24,12 @@
  * David Airlie
  */
 
-#include 
 #include 
-#include 
-#include 
-#include 
 
-#include 
-#include 
 #include 
-#include 
-#include 
 
 #include "radeon.h"
 
-/* object hierarchy -
- * this contains a helper + a radeon fb
- * the helper contains a pointer to radeon framebuffer baseclass.
- */
-struct radeon_fbdev {
-   struct drm_fb_helper helper; /* must be first */
-   struct drm_framebuffer fb;
-   struct radeon_device *rdev;
-};
-
-static int
-radeonfb_open(struct fb_info *info, int user)
-{
-   struct radeon_fbdev *rfbdev = info->par;
-   struct radeon_device *rdev = rfbdev->rdev;
-   int ret = pm_runtime_get_sync(rdev->ddev->dev);
-   if (ret < 0 && ret != -EACCES) {
-   pm_runtime_mark_last_busy(rdev->ddev->dev);
-   pm_runtime_put_autosuspend(rdev->ddev->dev);
-   return ret;
-   }
-   return 0;
-}
-
-static int
-radeonfb_release(struct fb_info *info, int user)
-{
-   struct radeon_fbdev *rfbdev = info->par;
-   struct radeon_device *rdev = rfbdev->rdev;
-
-   pm_runtime_mark_last_busy(rdev->ddev->dev);
-   pm_runtime_put_autosuspend(rdev->ddev->dev);
-   return 0;
-}
-
-static const struct fb_ops radeonfb_ops = {
-   .owner = THIS_MODULE,
-   DRM_FB_HELPER_DEFAULT_OPS,
-   .fb_open = radeonfb_open,
-   .fb_release = radeonfb_release,
-   .fb_fillrect = drm_fb_helper_cfb_fillrect,
-   .fb_copyarea = drm_fb_helper_cfb_copyarea,
-   .fb_imageblit = drm_fb_helper_cfb_imageblit,
-};
-
-
 int radeon_align_pitch(struct radeon_device *rdev, int width, int cpp, bool 
tiled)
 {
int aligned = width;
@@ -108,294 +54,35 @@ int radeon_align_pitch(struct radeon_device *rdev, int 
width, int cpp, bool tile
return aligned * cpp;
 }
 
-static void radeonfb_destroy_pinned_object(struct drm_gem_object *g

[PATCH 7/7] drm/radeon: Move radeon_align_pitch() next to its only caller

2020-11-12 Thread Thomas Zimmermann
Allows to declare the function as static. The tiled parameter is always
false, so it is being removed.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/radeon/radeon_fb.c   | 24 
 drivers/gpu/drm/radeon/radeon_gem.c  | 26 +-
 drivers/gpu/drm/radeon/radeon_mode.h |  2 --
 3 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_fb.c 
b/drivers/gpu/drm/radeon/radeon_fb.c
index c687d14a1b93..0b89dd4f4af6 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -30,30 +30,6 @@
 
 #include "radeon.h"
 
-int radeon_align_pitch(struct radeon_device *rdev, int width, int cpp, bool 
tiled)
-{
-   int aligned = width;
-   int align_large = (ASIC_IS_AVIVO(rdev)) || tiled;
-   int pitch_mask = 0;
-
-   switch (cpp) {
-   case 1:
-   pitch_mask = align_large ? 255 : 127;
-   break;
-   case 2:
-   pitch_mask = align_large ? 127 : 31;
-   break;
-   case 3:
-   case 4:
-   pitch_mask = align_large ? 63 : 15;
-   break;
-   }
-
-   aligned += pitch_mask;
-   aligned &= ~pitch_mask;
-   return aligned * cpp;
-}
-
 void radeon_fbdev_init(struct radeon_device *rdev)
 {
struct drm_device *ddev = rdev->ddev;
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c 
b/drivers/gpu/drm/radeon/radeon_gem.c
index eaf7fc9a7b07..e19956c3309f 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -816,6 +816,30 @@ int radeon_gem_op_ioctl(struct drm_device *dev, void *data,
return r;
 }
 
+static int radeon_align_pitch(struct radeon_device *rdev, int width, int cpp)
+{
+   int aligned = width;
+   int align_large = ASIC_IS_AVIVO(rdev);
+   int pitch_mask = 0;
+
+   switch (cpp) {
+   case 1:
+   pitch_mask = align_large ? 255 : 127;
+   break;
+   case 2:
+   pitch_mask = align_large ? 127 : 31;
+   break;
+   case 3:
+   case 4:
+   pitch_mask = align_large ? 63 : 15;
+   break;
+   }
+
+   aligned += pitch_mask;
+   aligned &= ~pitch_mask;
+   return aligned * cpp;
+}
+
 int radeon_mode_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args)
@@ -826,7 +850,7 @@ int radeon_mode_dumb_create(struct drm_file *file_priv,
int r;
 
args->pitch = radeon_align_pitch(rdev, args->width,
-DIV_ROUND_UP(args->bpp, 8), 0);
+DIV_ROUND_UP(args->bpp, 8));
args->size = args->pitch * args->height;
args->size = ALIGN(args->size, PAGE_SIZE);
 
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h 
b/drivers/gpu/drm/radeon/radeon_mode.h
index 197423ad42c1..50ba2b5edb93 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -982,8 +982,6 @@ void radeon_crtc_handle_vblank(struct radeon_device *rdev, 
int crtc_id);
 
 void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id);
 
-int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bool 
tiled);
-
 /* mst */
 int radeon_dp_mst_init(struct radeon_connector *radeon_connector);
 int radeon_dp_mst_probe(struct radeon_connector *radeon_connector);
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/7] drm/fb-helper: Add hint to enable VT switching during suspend/resume

2020-11-12 Thread Thomas Zimmermann
Switching VTs during suspend/resume is required to reliably run radeon
with generic fbdev emulation.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/drm_fb_helper.c | 8 +---
 include/drm/drm_mode_config.h   | 7 +++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index d2ba404a23b3..987cd781e62c 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -508,11 +508,11 @@ EXPORT_SYMBOL(drm_fb_helper_init);
  */
 struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
 {
-   struct device *dev = fb_helper->dev->dev;
+   struct drm_device *dev = fb_helper->dev;
struct fb_info *info;
int ret;
 
-   info = framebuffer_alloc(0, dev);
+   info = framebuffer_alloc(0, dev->dev);
if (!info)
return ERR_PTR(-ENOMEM);
 
@@ -535,7 +535,9 @@ struct fb_info *drm_fb_helper_alloc_fbi(struct 
drm_fb_helper *fb_helper)
}
 
fb_helper->fbdev = info;
-   info->skip_vt_switch = true;
+
+   if (!dev->mode_config.require_vt_switch_fbdev)
+   info->skip_vt_switch = true;
 
return info;
 
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index ab424ddd7665..59e0796c6928 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -877,6 +877,13 @@ struct drm_mode_config {
 */
bool prefer_shadow_fbdev;
 
+   /**
+* @require_vt_switch_fbdev:
+*
+* Hint to framebuffer emulation to enable VT switching on 
suspend/resume.
+*/
+   bool require_vt_switch_fbdev;
+
/**
 * @quirk_addfb_prefer_xbgr_30bpp:
 *
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 6/7] drm/radeon: Use fbdev shadow fb

2020-11-12 Thread Thomas Zimmermann
Fbdev framebuffer addresses are exported and mmap'ed to userspace, so the
framebuffer may not change its location. This creates memory pressure on
devices with little video RAM. Radeon mitigates this problem by reducing
the framebuffer's color depth on devices with 32 MiB or less.

Fully resolve the problem by enabling generic fbdev's shadow FB. All
userspace-visible memory is located in the shadow buffer. The underlying
BO can be evicted to system memory as needed, thus freeing video RAM for
more important uses.

Switching to a shadow framebuffer also allows to remove a special case in
BO handling, where the fbdev's BO was not evicted. Fbdev should now be
treated an any other framebuffer BO

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/radeon/radeon_device.c | 11 ---
 drivers/gpu/drm/radeon/radeon_fb.c | 17 ++---
 drivers/gpu/drm/radeon/radeon_mode.h   |  1 -
 3 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c 
b/drivers/gpu/drm/radeon/radeon_device.c
index 266e3cbbd09b..87c14f6369ee 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1605,13 +1605,10 @@ int radeon_suspend_kms(struct drm_device *dev, bool 
suspend,
continue;
}
robj = gem_to_radeon_bo(fb->obj[0]);
-   /* don't unpin kernel fb objects */
-   if (!radeon_fbdev_robj_is_fb(rdev, robj)) {
-   r = radeon_bo_reserve(robj, false);
-   if (r == 0) {
-   radeon_bo_unpin(robj);
-   radeon_bo_unreserve(robj);
-   }
+   r = radeon_bo_reserve(robj, false);
+   if (r == 0) {
+   radeon_bo_unpin(robj);
+   radeon_bo_unreserve(robj);
}
}
/* evict vram memory */
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c 
b/drivers/gpu/drm/radeon/radeon_fb.c
index 50fdc2aaa463..c687d14a1b93 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -59,14 +59,12 @@ void radeon_fbdev_init(struct radeon_device *rdev)
struct drm_device *ddev = rdev->ddev;
int bpp_sel = 32;
 
-   /* select 8 bpp console on 8MB cards, or 16 bpp on RN50 or 32MB */
-   if (rdev->mc.real_vram_size <= (8*1024*1024))
-   bpp_sel = 8;
-   else if (ASIC_IS_RN50(rdev) || rdev->mc.real_vram_size <= 
(32*1024*1024))
+   if (ASIC_IS_RN50(rdev))
bpp_sel = 16;
 
/* radeon resume is fragile and needs a vt switch to help it along */
ddev->mode_config.require_vt_switch_fbdev = true;
+   ddev->mode_config.prefer_shadow_fbdev = true;
 
drm_fbdev_generic_setup(ddev, bpp_sel);
 }
@@ -75,14 +73,3 @@ void radeon_fbdev_set_suspend(struct radeon_device *rdev, 
int state)
 {
drm_fb_helper_set_suspend(rdev->ddev->fb_helper, state);
 }
-
-bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo 
*robj)
-{
-   if (!rdev->ddev->fb_helper)
-   return false;
-
-   if (gem_to_radeon_bo(rdev->ddev->fb_helper->buffer->gem) != robj)
-   return false;
-
-   return true;
-}
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h 
b/drivers/gpu/drm/radeon/radeon_mode.h
index fe192ef0aafa..197423ad42c1 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -977,7 +977,6 @@ void dce8_program_fmt(struct drm_encoder *encoder);
 /* fbdev layer */
 void radeon_fbdev_init(struct radeon_device *rdev);
 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state);
-bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo 
*robj);
 
 void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id);
 
-- 
2.29.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] dt-bindings: display: mcde: Convert to YAML schema

2020-11-12 Thread Linus Walleij
On Wed, Nov 11, 2020 at 9:59 PM Sam Ravnborg  wrote:
> On Wed, Nov 11, 2020 at 02:07:54PM +0100, Linus Walleij wrote:

> > -- clocks: an array of the MCDE clocks in this strict order:
> > -  MCDECLK (main MCDE clock), LCDCLK (LCD clock), PLLDSI
> > -  (HDMI clock), DSI0ESCLK (DSI0 energy save clock),
>
> > -  DSI1ESCLK (DSI1 energy save clock), DSI2ESCLK (DSI2 energy
> > -  save clock)
>
> I did not find these two clocks in the binding below.

The old bindings are wrong. These clocks belong on the DSI
host adapters, so they are in this part of the binding:

+  clocks:
+description: phandles to the high speed and low power (energy
save) clocks
+  the high speed clock is not present on the third (dsi2) block, so it
+  should only have the "lp" clock
+minItems: 1
+maxItems: 2
+
+  clock-names:
+oneOf:
+  - items:
+  - const: hs
+  - const: lp
+  - items:
+  - const: lp

All device trees have these in the right place, we just didn't notice that
the bindings were wrong exactly because we weren't using
formal YAML syntax. Now the strictness of this parser makes me
fix my bugs...

> > +  port:
> > +type: object
> > +description:
> > +  A DPI port node with endpoint definitions as defined in
> > +  Documentation/devicetree/bindings/media/video-interfaces.txt
> > +
> > +  "#address-cells":
> > +const: 1
> > +
> > +  "#size-cells":
> > +const: 1
> > +
> > +  ranges: true
>
> This is a transition from .txt to DT Schema so OK with this sub-node.
> But otherwise the dsi node should have been linked using graph nodes.
> So OK - just thinking out loud.

Actually when I introduced the MCDE DSI last year at first I used port
and graphs:
https://lore.kernel.org/dri-devel/20190207083647.20615-3-linus.wall...@linaro.org/
Then Rob asked "why?":
https://lore.kernel.org/dri-devel/20190225223124.GA29057@bogus/
And then I removed it, as having a panel directly under a
DSI host is fine.

> > +patternProperties:
> > +  "^dsi@[0-9a-f]+$":
> > +description: subnodes for the three DSI host adapters
> > +type: object
> > +allOf:
> > +  - $ref: dsi-controller.yaml#
(...)
> The dsi nodes needs the #address-cells and #size-cells - at least if a
> panel node is specified.

This is specified in the referenced schema dsi-controller.yaml.

> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - clocks
> > +  - clock-names
> > +  - epod-supply
> > +  - vana-supply
> > +
> > +additionalProperties: true
>
> Why are additional properties allowed here?

It's because the SoC peripherals have things like pin control
(currently handled by a quirk in the YAML validator I think) and
resets is something else I will likely add at some point, and then
this would result in warnings unless I lock-step changes in the
schema and DTS files.

I *can* disallow this if you insist.

Yours.
Linus Walleij
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 RFC 5/5] fbcon: Avoid using FNTCHARCNT() and hard-coded built-in font charcount

2020-11-12 Thread Peilin Ye
For user-provided fonts, the framebuffer layer is using a magic
negative-indexing macro, FNTCHARCNT(), to keep track of their number of
characters:

#define FNTCHARCNT(fd)  (((int *)(fd))[-3])

For built-in fonts, it is using hard-coded values (256). This results in
something like the following:

map.length = (ops->p->userfont) ?
FNTCHARCNT(ops->p->fontdata) : 256;

This is unsatisfactory. In fact, there is already a `charcount` field in
our virtual console descriptor (see `struct console_font` inside `struct
vc_data`), let us use it:

map.length = vc->vc_font.charcount;

Recently we added a `charcount` field to `struct font_desc`. Use it to set
`vc->vc_font.charcount` properly. The idea is:

  - We only use FNTCHARCNT() on `vc->vc_font.data` and `p->fontdata`.
Assume FNTCHARCNT() is working as intended;
  - Whenever `vc->vc_font.data` is set, also set `vc->vc_font.charcount`
properly;
  - We can now replace `FNTCHARCNT(vc->vc_font.data)` with
`vc->vc_font.charcount`;
  - Since `p->fontdata` always point to the same font data buffer with
`vc->vc_font.data`, we can also replace `FNTCHARCNT(p->fontdata)` with
`vc->vc_font.charcount`.

In conclusion, set `vc->vc_font.charcount` properly in fbcon_startup(),
fbcon_init(), fbcon_set_disp() and fbcon_do_set_font(), then replace
FNTCHARCNT() with `vc->vc_font.charcount`. No more if-else between
negative-indexing macros and hard-coded values.

Do not include  in fbcon_rotate.c and tileblit.c, since they
no longer need it.

Depends on patch "Fonts: Add charcount field to font_desc".

Suggested-by: Daniel Vetter 
Signed-off-by: Peilin Ye 
---
v2: https://lore.kernel.org/lkml/20201028155139.1220549-1-yepeilin...@gmail.com/

Boot-tested only, thus the "RFC". Looking forward to suggestions about how
to test this properly. Thank you!

I am not very sure about the statement "`p->fontdata` always point to the
same font data buffer with `vc->vc_font.data`". It is concluded from code
reading.

Change in v3:
  - Do not touch fbcon_copy_font() since we removed it in patch "console:
Delete unused con_font_copy() callback implementations"

Changes in v2:
  - Try avoid using FNTCHARCNT() altogether, instead of only changing a
little bit (Daniel)
  - Set `vc->vc_font.charcount` properly, in fbcon_startup(),
fbcon_init(), fbcon_set_disp() and fbcon_do_set_font()
  - Replace hard-coded 256 whenever possible

 drivers/video/fbdev/core/fbcon.c| 57 +
 drivers/video/fbdev/core/fbcon_rotate.c |  3 +-
 drivers/video/fbdev/core/tileblit.c |  4 +-
 3 files changed, 23 insertions(+), 41 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 26d1b0916692..06520667fc07 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1004,7 +1004,7 @@ static const char *fbcon_startup(void)
vc->vc_font.width = font->width;
vc->vc_font.height = font->height;
vc->vc_font.data = (void *)(p->fontdata = font->data);
-   vc->vc_font.charcount = 256; /* FIXME  Need to support more 
fonts */
+   vc->vc_font.charcount = font->charcount;
} else {
p->fontdata = vc->vc_font.data;
}
@@ -1032,7 +1032,7 @@ static void fbcon_init(struct vc_data *vc, int init)
struct vc_data **default_mode = vc->vc_display_fg;
struct vc_data *svc = *default_mode;
struct fbcon_display *t, *p = &fb_display[vc->vc_num];
-   int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+   int logo = 1, new_rows, new_cols, rows, cols;
int cap, ret;
 
if (WARN_ON(info_idx == -1))
@@ -1068,6 +1068,7 @@ static void fbcon_init(struct vc_data *vc, int init)
fvc->vc_font.data);
vc->vc_font.width = fvc->vc_font.width;
vc->vc_font.height = fvc->vc_font.height;
+   vc->vc_font.charcount = fvc->vc_font.charcount;
p->userfont = t->userfont;
 
if (p->userfont)
@@ -1083,17 +1084,13 @@ static void fbcon_init(struct vc_data *vc, int init)
vc->vc_font.width = font->width;
vc->vc_font.height = font->height;
vc->vc_font.data = (void *)(p->fontdata = font->data);
-   vc->vc_font.charcount = 256; /* FIXME  Need to
-   support more fonts */
+   vc->vc_font.charcount = font->charcount;
}
}
 
-   if (p->userfont)
-   charcnt = FNTCHARCNT(p->fontdata);
-
vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1);
vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
-   if (charcnt == 256) {
+   if (v

[PATCH v3 4/5] parisc/sticore: Avoid hard-coding built-in font charcount

2020-11-12 Thread Peilin Ye
sti_select_fbfont() and sti_cook_fonts() are hard-coding the number of
characters of our built-in fonts as 256. Recently, we included that
information in our kernel font descriptor `struct font_desc`, so use
`fbfont->charcount` instead of hard-coded values.

Depends on patch "Fonts: Add charcount field to font_desc".

Signed-off-by: Peilin Ye 
Reviewed-by: Daniel Vetter 
---
v2: 
https://lore.kernel.org/lkml/c38042bbf5c9777c84900d56c09f3c156b32af48.1603788512.git.yepeilin...@gmail.com/

Changes since v1:
  - Slightly improved commit message.
  - Rebased onto linux-next.

 drivers/video/console/sticore.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index d1bb5915082b..f869b723494f 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -506,7 +506,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const 
char *fbfont_name)
fbfont->width, fbfont->height, fbfont->name);

bpc = ((fbfont->width+7)/8) * fbfont->height; 
-   size = bpc * 256;
+   size = bpc * fbfont->charcount;
size += sizeof(struct sti_rom_font);
 
nf = kzalloc(size, STI_LOWMEM);
@@ -514,7 +514,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const 
char *fbfont_name)
return NULL;
 
nf->first_char = 0;
-   nf->last_char = 255;
+   nf->last_char = fbfont->charcount - 1;
nf->width = fbfont->width;
nf->height = fbfont->height;
nf->font_type = STI_FONT_HPROMAN8;
@@ -525,7 +525,7 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const 
char *fbfont_name)
 
dest = nf;
dest += sizeof(struct sti_rom_font);
-   memcpy(dest, fbfont->data, bpc*256);
+   memcpy(dest, fbfont->data, bpc * fbfont->charcount);
 
cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
if (!cooked_font) {
@@ -660,7 +660,7 @@ static int sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
 void sti_font_convert_bytemode(struct sti_struct *sti, struct sti_cooked_font 
*f)
 {
unsigned char *n, *p, *q;
-   int size = f->raw->bytes_per_char * 256 + sizeof(struct sti_rom_font);
+   int size = f->raw->bytes_per_char * (f->raw->last_char + 1) + 
sizeof(struct sti_rom_font);
struct sti_rom_font *old_font;
 
if (sti->wordmode)
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 3/5] Fonts: Add charcount field to font_desc

2020-11-12 Thread Peilin Ye
Subsystems are hard-coding the number of characters of our built-in fonts
as 256. Include that information in our kernel font descriptor, `struct
font_desc`.

Signed-off-by: Peilin Ye 
Reviewed-by: Daniel Vetter 
---
v2: https://lore.kernel.org/lkml/20201028060533.1206307-1-yepeilin...@gmail.com/

Change in v3:
  - Rebase onto linux-next.

Change in v2:
  - Rebase onto 5.10-rc1.

 include/linux/font.h   | 1 +
 lib/fonts/font_10x18.c | 1 +
 lib/fonts/font_6x10.c  | 1 +
 lib/fonts/font_6x11.c  | 1 +
 lib/fonts/font_6x8.c   | 1 +
 lib/fonts/font_7x14.c  | 1 +
 lib/fonts/font_8x16.c  | 1 +
 lib/fonts/font_8x8.c   | 1 +
 lib/fonts/font_acorn_8x8.c | 1 +
 lib/fonts/font_mini_4x6.c  | 1 +
 lib/fonts/font_pearl_8x8.c | 1 +
 lib/fonts/font_sun12x22.c  | 1 +
 lib/fonts/font_sun8x16.c   | 1 +
 lib/fonts/font_ter16x32.c  | 1 +
 14 files changed, 14 insertions(+)

diff --git a/include/linux/font.h b/include/linux/font.h
index 4f50d736ea72..abf1442ce719 100644
--- a/include/linux/font.h
+++ b/include/linux/font.h
@@ -17,6 +17,7 @@ struct font_desc {
 int idx;
 const char *name;
 unsigned int width, height;
+unsigned int charcount;
 const void *data;
 int pref;
 };
diff --git a/lib/fonts/font_10x18.c b/lib/fonts/font_10x18.c
index e02f9df24d1e..5d940db626e7 100644
--- a/lib/fonts/font_10x18.c
+++ b/lib/fonts/font_10x18.c
@@ -5137,6 +5137,7 @@ const struct font_desc font_10x18 = {
.name   = "10x18",
.width  = 10,
.height = 18,
+   .charcount = 256,
.data   = fontdata_10x18.data,
 #ifdef __sparc__
.pref   = 5,
diff --git a/lib/fonts/font_6x10.c b/lib/fonts/font_6x10.c
index 6e3c4b7691c8..e65df019e0d2 100644
--- a/lib/fonts/font_6x10.c
+++ b/lib/fonts/font_6x10.c
@@ -3083,6 +3083,7 @@ const struct font_desc font_6x10 = {
.name   = "6x10",
.width  = 6,
.height = 10,
+   .charcount = 256,
.data   = fontdata_6x10.data,
.pref   = 0,
 };
diff --git a/lib/fonts/font_6x11.c b/lib/fonts/font_6x11.c
index 2d22a24e816f..bd76b3f6b635 100644
--- a/lib/fonts/font_6x11.c
+++ b/lib/fonts/font_6x11.c
@@ -3346,6 +3346,7 @@ const struct font_desc font_vga_6x11 = {
.name   = "ProFont6x11",
.width  = 6,
.height = 11,
+   .charcount = 256,
.data   = fontdata_6x11.data,
/* Try avoiding this font if possible unless on MAC */
.pref   = -2000,
diff --git a/lib/fonts/font_6x8.c b/lib/fonts/font_6x8.c
index e7442a0d183d..06ace7792521 100644
--- a/lib/fonts/font_6x8.c
+++ b/lib/fonts/font_6x8.c
@@ -2571,6 +2571,7 @@ const struct font_desc font_6x8 = {
.name   = "6x8",
.width  = 6,
.height = 8,
+   .charcount = 256,
.data   = fontdata_6x8.data,
.pref   = 0,
 };
diff --git a/lib/fonts/font_7x14.c b/lib/fonts/font_7x14.c
index 9cc7ae2e03f7..a2f561c9fa04 100644
--- a/lib/fonts/font_7x14.c
+++ b/lib/fonts/font_7x14.c
@@ -4113,6 +4113,7 @@ const struct font_desc font_7x14 = {
.name   = "7x14",
.width  = 7,
.height = 14,
+   .charcount = 256,
.data   = fontdata_7x14.data,
.pref   = 0,
 };
diff --git a/lib/fonts/font_8x16.c b/lib/fonts/font_8x16.c
index bab25dc59e8d..06ae14088514 100644
--- a/lib/fonts/font_8x16.c
+++ b/lib/fonts/font_8x16.c
@@ -4627,6 +4627,7 @@ const struct font_desc font_vga_8x16 = {
.name   = "VGA8x16",
.width  = 8,
.height = 16,
+   .charcount = 256,
.data   = fontdata_8x16.data,
.pref   = 0,
 };
diff --git a/lib/fonts/font_8x8.c b/lib/fonts/font_8x8.c
index 109d0572368f..69570b8c31af 100644
--- a/lib/fonts/font_8x8.c
+++ b/lib/fonts/font_8x8.c
@@ -2578,6 +2578,7 @@ const struct font_desc font_vga_8x8 = {
.name   = "VGA8x8",
.width  = 8,
.height = 8,
+   .charcount = 256,
.data   = fontdata_8x8.data,
.pref   = 0,
 };
diff --git a/lib/fonts/font_acorn_8x8.c b/lib/fonts/font_acorn_8x8.c
index fb395f0d4031..18755c33d249 100644
--- a/lib/fonts/font_acorn_8x8.c
+++ b/lib/fonts/font_acorn_8x8.c
@@ -270,6 +270,7 @@ const struct font_desc font_acorn_8x8 = {
.name   = "Acorn8x8",
.width  = 8,
.height = 8,
+   .charcount = 256,
.data   = acorndata_8x8.data,
 #ifdef CONFIG_ARCH_ACORN
.pref   = 20,
diff --git a/lib/fonts/font_mini_4x6.c b/lib/fonts/font_mini_4x6.c
index 592774a90917..8d39fd447952 100644
--- a/lib/fonts/font_mini_4x6.c
+++ b/lib/fonts/font_mini_4x6.c
@@ -2152,6 +2152,7 @@ const struct font_desc font_mini_4x6 = {
.name   = "MINI4x6",
.width  = 4,
.height = 6,
+   .charcount = 256,
.data   = fontdata_mini_4x6.data,
.pref   = 3,
 };
diff --git a/lib/fonts/font_pearl_8x8.c b/lib/fonts/font_pearl_8x8.c
index a6f95ebce950..b1678ed0017c 100644
--- a/lib/fonts/font_pearl_8x8.c
+++ b/lib/fonts/font_pearl_8x8.c
@@ -2582,6 +2582,7 @@ const struct font_desc font_pearl_8x8 = {
.name   = 

[PATCH v3 2/5] console: Delete dummy con_font_set() and con_font_default() callback implementations

2020-11-12 Thread Peilin Ye
.con_font_set and .con_font_default callbacks should not pass `struct
console_font *` as a parameter, since `struct console_font` is a UAPI
structure.

We are trying to let them use our new kernel font descriptor, `struct
font_desc` instead. To make that work slightly easier, first delete all of
their no-op implementations used by dummy consoles.

This will make KD_FONT_OP_SET and KD_FONT_OP_SET_DEFAULT ioctl() requests
on dummy consoles start to fail and return `-ENOSYS`, which is intended,
since no user should ever expect such operations to succeed on dummy
consoles.

Suggested-by: Daniel Vetter 
Signed-off-by: Peilin Ye 
Reviewed-by: Greg Kroah-Hartman 
---
v2: 
https://lore.kernel.org/lkml/c5563eeea36aae7bd72ea2e985bc610d585ece40.1604306433.git.yepeilin...@gmail.com/

Strictly speaking this is different from v2 (see changelog), but it really
shouldn't matter, so I'm keeping Greg's "Reviewed-by:".

Changes in v3:
  - Improve commit message. (Jiri)
  - Do not delete con_font_copy() callbacks, since they have been deleted
in patch "console: Delete unused con_font_copy() callback
implementations".

Change in v2:
  - Do not Cc: stable.

 drivers/usb/misc/sisusbvga/sisusb_con.c | 15 ---
 drivers/video/console/dummycon.c| 14 --
 2 files changed, 29 deletions(-)

diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c 
b/drivers/usb/misc/sisusbvga/sisusb_con.c
index fd9954381fbf..dfa0d5ce6012 100644
--- a/drivers/usb/misc/sisusbvga/sisusb_con.c
+++ b/drivers/usb/misc/sisusbvga/sisusb_con.c
@@ -1345,19 +1345,6 @@ static int sisusbdummycon_blank(struct vc_data *vc, int 
blank, int mode_switch)
return 0;
 }
 
-static int sisusbdummycon_font_set(struct vc_data *vc,
-  struct console_font *font,
-  unsigned int flags)
-{
-   return 0;
-}
-
-static int sisusbdummycon_font_default(struct vc_data *vc,
-  struct console_font *font, char *name)
-{
-   return 0;
-}
-
 static const struct consw sisusb_dummy_con = {
.owner =THIS_MODULE,
.con_startup =  sisusbdummycon_startup,
@@ -1370,8 +1357,6 @@ static const struct consw sisusb_dummy_con = {
.con_scroll =   sisusbdummycon_scroll,
.con_switch =   sisusbdummycon_switch,
.con_blank =sisusbdummycon_blank,
-   .con_font_set = sisusbdummycon_font_set,
-   .con_font_default = sisusbdummycon_font_default,
 };
 
 int
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index ab3df752fb57..f1711b2f9ff0 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -124,18 +124,6 @@ static int dummycon_switch(struct vc_data *vc)
return 0;
 }
 
-static int dummycon_font_set(struct vc_data *vc, struct console_font *font,
-unsigned int flags)
-{
-   return 0;
-}
-
-static int dummycon_font_default(struct vc_data *vc,
-struct console_font *font, char *name)
-{
-   return 0;
-}
-
 /*
  *  The console `switch' structure for the dummy console
  *
@@ -154,7 +142,5 @@ const struct consw dummy_con = {
.con_scroll =   dummycon_scroll,
.con_switch =   dummycon_switch,
.con_blank =dummycon_blank,
-   .con_font_set = dummycon_font_set,
-   .con_font_default = dummycon_font_default,
 };
 EXPORT_SYMBOL_GPL(dummy_con);
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


  1   2   >