[Freedreno] [PATCH 00/20] Convert all remaining drivers to GEM object functions

2020-08-13 Thread Thomas Zimmermann
The GEM and PRIME related callbacks in struct drm_driver are deprecated in favor of GEM object functions in struct drm_gem_object_funcs. This patchset converts the remaining drivers to object functions and removes most of the obsolete interfaces. Patches #1 to #18 convert DRM drivers to GEM object

[Freedreno] [PATCH 06/20] drm/i915: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in i915. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 9 - drivers/gpu/drm/i915/i9

[Freedreno] [PATCH 01/20] drm/amdgpu: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in amdgpu. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm

[Freedreno] [PATCH 08/20] drm/msm: Introduce GEM object funcs

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in msm. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/ms

[Freedreno] [PATCH 04/20] drm/exynos: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in exynos. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm

[Freedreno] [PATCH 09/20] drm/nouveau: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in nouveau. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/nouveau/nouveau_drm.c | 9 - drivers/gpu/drm/nouveau/nouve

[Freedreno] [PATCH 11/20] drm/pl111: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in pl111. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/

[Freedreno] [PATCH 05/20] drm/gma500: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in gma500. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/gma500/framebuffer.c | 2 ++ drivers/gpu/drm/gma500/gem.c | 1

[Freedreno] [PATCH 12/20] drm/radeon: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in radeon. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/radeon_drv.c| 23 +-- drivers/gpu/drm/r

[Freedreno] [PATCH 02/20] drm/armada: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in armada. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/armada/armada_drv.c | 3 --- drivers/gpu/drm/armada/armada_gem.c | 12

[Freedreno] [PATCH 07/20] drm/mediatek: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in mediatek. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/d

[Freedreno] [PATCH 03/20] drm/etnaviv: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in etnaviv. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/dr

[Freedreno] [PATCH 17/20] drm/vkms: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in vkms. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/vkms/vkms_drv.c | 8 drivers/gpu/drm/vkms/vkms_gem.c | 13

[Freedreno] [PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver

2020-08-13 Thread Thomas Zimmermann
Several GEM and PRIME callbacks have been deprecated in favor of per-instance GEM object functions. Remove the callbacks as they are now unused. The only exception is .gem_prime_mmap, which is still in use by several drivers. What is also gone is gem_vm_ops in struct drm_driver. All drivers now us

[Freedreno] [PATCH 14/20] drm/tegra: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in tegra. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tegra/drm.c | 4 drivers/gpu/drm/tegra/gem.c | 8 2 files

[Freedreno] [PATCH 15/20] drm/vc4: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in vc4. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/vc

[Freedreno] [PATCH 10/20] drm/omapdrm: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in omapdrm. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/omapdrm/omap_drv.c | 9 - drivers/gpu/drm/omapdrm/omap_gem.c

[Freedreno] [PATCH 18/20] drm/xen: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in xen. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/xe

[Freedreno] [PATCH 13/20] drm/rockchip: Convert to drm_gem_object_funcs

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in rockchip. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/d

[Freedreno] [PATCH 16/20] drm/vgem: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in vgem. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/v

[Freedreno] [PATCH 19/20] drm/xlnx: Initialize DRM driver instance with CMA helper macro

2020-08-13 Thread Thomas Zimmermann
The xlnx driver uses CMA helpers with default callback functions. Initialize the driver structure with the rsp CMA helper macro. The driver is being converted to use GEM object functions as part of this change. Two callbacks, .dumb_destroy and .gem_prime_import, were initialized to their default i

Re: [Freedreno] [PATCH 06/20] drm/i915: Introduce GEM object functions

2020-08-13 Thread Jani Nikula
On Thu, 13 Aug 2020, Thomas Zimmermann wrote: > GEM object functions deprecate several similar callback interfaces in > struct drm_driver. This patch replaces the per-driver callbacks with > per-instance callbacks in i915. > > Signed-off-by: Thomas Zimmermann > --- > drivers/gpu/drm/i915/gem/i91

Re: [Freedreno] [PATCH 06/20] drm/i915: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
Hi Am 13.08.20 um 11:08 schrieb Jani Nikula: > On Thu, 13 Aug 2020, Thomas Zimmermann wrote: >> GEM object functions deprecate several similar callback interfaces in >> struct drm_driver. This patch replaces the per-driver callbacks with >> per-instance callbacks in i915. >> >> Signed-off-by: Tho

Re: [Freedreno] [PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver

2020-08-13 Thread Sam Ravnborg
Hi Thomas. On Thu, Aug 13, 2020 at 10:36:44AM +0200, Thomas Zimmermann wrote: > Several GEM and PRIME callbacks have been deprecated in favor of > per-instance GEM object functions. Remove the callbacks as they are > now unused. The only exception is .gem_prime_mmap, which is still > in use by sev

Re: [Freedreno] [PATCH 01/20] drm/amdgpu: Introduce GEM object functions

2020-08-13 Thread Christian König
Am 13.08.20 um 10:36 schrieb Thomas Zimmermann: GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in amdgpu. The only exception is gem_prime_mmap, which is non-trivial to convert. Sign

Re: [Freedreno] [PATCH 12/20] drm/radeon: Introduce GEM object functions

2020-08-13 Thread Christian König
Am 13.08.20 um 10:36 schrieb Thomas Zimmermann: GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in radeon. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/radeon/radeon_drv.c

Re: [Freedreno] [PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver

2020-08-13 Thread Thomas Zimmermann
Hi Am 13.08.20 um 12:16 schrieb Sam Ravnborg: > Hi Thomas. > > On Thu, Aug 13, 2020 at 10:36:44AM +0200, Thomas Zimmermann wrote: >> Several GEM and PRIME callbacks have been deprecated in favor of >> per-instance GEM object functions. Remove the callbacks as they are >> now unused. The only exce

Re: [Freedreno] [PATCH 12/20] drm/radeon: Introduce GEM object functions

2020-08-13 Thread Thomas Zimmermann
Hi Am 13.08.20 um 12:24 schrieb Christian König: > Am 13.08.20 um 10:36 schrieb Thomas Zimmermann: >> GEM object functions deprecate several similar callback interfaces in >> struct drm_driver. This patch replaces the per-driver callbacks with >> per-instance callbacks in radeon. >> >> Signed-off-

Re: [Freedreno] [PATCH 12/20] drm/radeon: Introduce GEM object functions

2020-08-13 Thread Christian König
Am 13.08.20 um 12:41 schrieb Thomas Zimmermann: Hi Am 13.08.20 um 12:24 schrieb Christian König: Am 13.08.20 um 10:36 schrieb Thomas Zimmermann: GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instan

Re: [Freedreno] [RFC v12 13/13] iommu/arm-smmu: Add a init_context_bank implementation hook

2020-08-13 Thread Will Deacon
On Mon, Aug 10, 2020 at 04:26:57PM -0600, Jordan Crouse wrote: > Add a new implementation hook to allow the implementation specific code > to tweek the context bank configuration just before it gets written. > The first user will be the Adreno GPU implementation to turn on > SCTLR.HUPCF to ensure t

Re: [Freedreno] [PATCH v12 04/13] iommu: Add a domain attribute to get/set a pagetable configuration

2020-08-13 Thread Will Deacon
On Mon, Aug 10, 2020 at 04:26:48PM -0600, Jordan Crouse wrote: > Add domain attribute DOMAIN_ATTR_PGTABLE_CFG. This will be used by > arm-smmu to share the current pagetable configuration with the > leaf driver and to allow the leaf driver to set up a new pagetable > configuration under certain cir

Re: [Freedreno] [PATCH v12 00/13] iommu/arm-smmu: Add Adreno SMMU specific implementation

2020-08-13 Thread Will Deacon
On Mon, Aug 10, 2020 at 04:26:44PM -0600, Jordan Crouse wrote: > This series adds an Adreno SMMU implementation to arm-smmu to allow GPU > hardware > pagetable switching. > > The Adreno GPU has built in capabilities to switch the TTBR0 pagetable during > runtime to allow each individual instance

Re: [Freedreno] [PATCH v12 05/13] iommu/arm-smmu-qcom: Add implementation for the adreno GPU SMMU

2020-08-13 Thread Will Deacon
On Mon, Aug 10, 2020 at 04:26:49PM -0600, Jordan Crouse wrote: > Add a special implementation for the SMMU attached to most Adreno GPU > target triggered from the qcom,adreno-smmu compatible string. > > The new Adreno SMMU implementation will enable split pagetables > (TTBR1) for the domain attach

Re: [Freedreno] [PATCH 19/20] drm/xlnx: Initialize DRM driver instance with CMA helper macro

2020-08-13 Thread Laurent Pinchart
Hi Thomas, Thank you for the patch. On Thu, Aug 13, 2020 at 10:36:43AM +0200, Thomas Zimmermann wrote: > The xlnx driver uses CMA helpers with default callback functions. > Initialize the driver structure with the rsp CMA helper macro. The > driver is being converted to use GEM object functions a

Re: [Freedreno] [PATCH 10/20] drm/omapdrm: Introduce GEM object functions

2020-08-13 Thread Laurent Pinchart
Hi Thomas, Thank you for the patch. On Thu, Aug 13, 2020 at 10:36:34AM +0200, Thomas Zimmermann wrote: > GEM object functions deprecate several similar callback interfaces in > struct drm_driver. This patch replaces the per-driver callbacks with > per-instance callbacks in omapdrm. > > Signed-of

Re: [Freedreno] [PATCH 19/20] drm/xlnx: Initialize DRM driver instance with CMA helper macro

2020-08-13 Thread Thomas Zimmermann
Hi Am 13.08.20 um 15:36 schrieb Laurent Pinchart: > Hi Thomas, > > Thank you for the patch. > > On Thu, Aug 13, 2020 at 10:36:43AM +0200, Thomas Zimmermann wrote: >> The xlnx driver uses CMA helpers with default callback functions. >> Initialize the driver structure with the rsp CMA helper macro

Re: [Freedreno] stable-rc 4.14: arm64: Internal error: Oops: clk_reparent __clk_set_parent_before on db410c

2020-08-13 Thread Naresh Kamboju
On Wed, 12 Aug 2020 at 23:14, Stephen Boyd wrote: > > Quoting Stephen Boyd (2020-07-23 03:26:02) > > Quoting Naresh Kamboju (2020-07-23 03:10:37) > > > On Thu, 23 Jul 2020 at 13:36, Stephen Boyd wrote: > > > > > > > > It sounds like maybe you need this patch? > > > > > > > > bdcf1dc25324 ("clk: E

Re: [Freedreno] [PATCH v12 04/13] iommu: Add a domain attribute to get/set a pagetable configuration

2020-08-13 Thread Rob Clark
On Thu, Aug 13, 2020 at 6:14 AM Will Deacon wrote: > > On Mon, Aug 10, 2020 at 04:26:48PM -0600, Jordan Crouse wrote: > > Add domain attribute DOMAIN_ATTR_PGTABLE_CFG. This will be used by > > arm-smmu to share the current pagetable configuration with the > > leaf driver and to allow the leaf driv

Re: [Freedreno] [PATCH v12 04/13] iommu: Add a domain attribute to get/set a pagetable configuration

2020-08-13 Thread Will Deacon
On Thu, Aug 13, 2020 at 08:11:02AM -0700, Rob Clark wrote: > On Thu, Aug 13, 2020 at 6:14 AM Will Deacon wrote: > > > > On Mon, Aug 10, 2020 at 04:26:48PM -0600, Jordan Crouse wrote: > > > Add domain attribute DOMAIN_ATTR_PGTABLE_CFG. This will be used by > > > arm-smmu to share the current pageta

Re: [Freedreno] [PATCH v12 07/13] drm/msm: Add a context pointer to the submitqueue

2020-08-13 Thread Rob Clark
On Mon, Aug 10, 2020 at 3:27 PM Jordan Crouse wrote: > > Each submitqueue is attached to a context. Add a pointer to the > context to the submitqueue at create time and refcount it so > that it stays around through the life of the queue. > > GPU submissions can access the active context via the su

Re: [Freedreno] [PATCH v12 04/13] iommu: Add a domain attribute to get/set a pagetable configuration

2020-08-13 Thread Rob Clark
On Thu, Aug 13, 2020 at 8:19 AM Will Deacon wrote: > > On Thu, Aug 13, 2020 at 08:11:02AM -0700, Rob Clark wrote: > > On Thu, Aug 13, 2020 at 6:14 AM Will Deacon wrote: > > > > > > On Mon, Aug 10, 2020 at 04:26:48PM -0600, Jordan Crouse wrote: > > > > Add domain attribute DOMAIN_ATTR_PGTABLE_CFG.

Re: [Freedreno] [PATCH v12 07/13] drm/msm: Add a context pointer to the submitqueue

2020-08-13 Thread Rob Clark
On Mon, Aug 10, 2020 at 3:27 PM Jordan Crouse wrote: > > Each submitqueue is attached to a context. Add a pointer to the > context to the submitqueue at create time and refcount it so > that it stays around through the life of the queue. > > GPU submissions can access the active context via the su

[Freedreno] [PATCH] drm/msm/a6xx: fix frequency not always being restored on GMU resume

2020-08-13 Thread Jonathan Marek
The patch reorganizing the set_freq function made it so the gmu resume doesn't always set the frequency, because a6xx_gmu_set_freq() exits early when the frequency hasn't been changed. Note this always happens when resuming GMU after recovering from a hang. Use a simple workaround to prevent this

[Freedreno] [RESEND PATCH] drm/msm/a6xx: fix frequency not always being restored on GMU resume

2020-08-13 Thread Jonathan Marek
The patch reorganizing the set_freq function made it so the gmu resume doesn't always set the frequency, because a6xx_gmu_set_freq() exits early when the frequency hasn't been changed. Note this always happens when resuming GMU after recovering from a hang. Use a simple workaround to prevent this

Re: [Freedreno] [PATCH 18/20] drm/xen: Introduce GEM object functions

2020-08-13 Thread Oleksandr Andrushchenko
Hi, On 8/13/20 11:36 AM, Thomas Zimmermann wrote: > GEM object functions deprecate several similar callback interfaces in > struct drm_driver. This patch replaces the per-driver callbacks with > per-instance callbacks in xen. The only exception is gem_prime_mmap, > which is non-trivial to convert.

[Freedreno] [PATCH 01/19] drm/msm: remove dangling submitqueue references

2020-08-13 Thread Rob Clark
From: Rob Clark Currently it doesn't matter, since we free the ctx immediately. But when we start refcnt'ing the ctx, we don't want old dangling list entries to hang around. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_submitqueue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletio

[Freedreno] [PATCH 00/19] iommu/arm-smmu + drm/msm: per-process GPU pgtables

2020-08-13 Thread Rob Clark
From: Rob Clark NOTE: Since Jordan was out today, and I wanted to keep things moving on this, I took the liberty of respinning his series (originally titled "iommu/arm-smmu: Add Adreno SMMU specific implementation") with updates based on Will's review comments, and some fixes an

[Freedreno] [PATCH 05/19] iommu: add private interface for adreno-smmu

2020-08-13 Thread Rob Clark
From: Rob Clark This interface will be used for drm/msm to coordinate with the qcom_adreno_smmu_impl to enable/disable TTBR0 translation. Once TTBR0 translation is enabled, the GPU's CP (Command Processor) will directly switch TTBR0 pgtables (and do the necessary TLB inv) synchronized to the GPU

[Freedreno] [PATCH 11/19] drm/msm: Add a context pointer to the submitqueue

2020-08-13 Thread Rob Clark
From: Jordan Crouse Each submitqueue is attached to a context. Add a pointer to the context to the submitqueue at create time and refcount it so that it stays around through the life of the queue. Co-developed-by: Rob Clark Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark --- drivers/gp

[Freedreno] [PATCH 02/19] iommu/arm-smmu: Pass io-pgtable config to implementation specific function

2020-08-13 Thread Rob Clark
From: Jordan Crouse Construct the io-pgtable config before calling the implementation specific init_context function and pass it so the implementation specific function can get a chance to change it before the io-pgtable is created. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark --- dr

[Freedreno] [PATCH 03/19] iommu/arm-smmu: Add support for split pagetables

2020-08-13 Thread Rob Clark
From: Jordan Crouse Enable TTBR1 for a context bank if IO_PGTABLE_QUIRK_ARM_TTBR1 is selected by the io-pgtable configuration. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 21 - drivers/iommu/arm/arm-smmu/arm-smmu.h | 25

[Freedreno] [PATCH 09/19] iommu/arm-smmu-qcom: Add implementation for the adreno GPU SMMU

2020-08-13 Thread Rob Clark
From: Jordan Crouse Add a special implementation for the SMMU attached to most Adreno GPU target triggered from the qcom,adreno-smmu compatible string. The new Adreno SMMU implementation will enable split pagetables (TTBR1) for the domain attached to the GPU device (SID 0) and hard code it conte

[Freedreno] [PATCH 07/19] drm/msm: set adreno_smmu as gpu's drvdata

2020-08-13 Thread Rob Clark
From: Rob Clark This will be populated by adreno-smmu, to provide a way for coordinating enabling/disabling TTBR0 translation. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/adreno_device.c | 2 -- drivers/gpu/drm/msm/msm_gpu.c | 2 +- drivers/gpu/drm/msm/msm_gpu.h

[Freedreno] [PATCH 08/19] iommu/arm-smmu: constify some helpers

2020-08-13 Thread Rob Clark
From: Rob Clark Sprinkle a few `const`s where helpers don't need write access. Signed-off-by: Rob Clark --- drivers/iommu/arm/arm-smmu/arm-smmu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-sm

[Freedreno] [PATCH 10/19] dt-bindings: arm-smmu: Add compatible string for Adreno GPU SMMU

2020-08-13 Thread Rob Clark
From: Jordan Crouse Every Qcom Adreno GPU has an embedded SMMU for its own use. These devices depend on unique features such as split pagetables, different stall/halt requirements and other settings. Identify them with a compatible string so that they can be identified in the arm-smmu implementat

[Freedreno] [PATCH 06/19] drm/msm/gpu: add dev_to_gpu() helper

2020-08-13 Thread Rob Clark
From: Rob Clark In a later patch, the drvdata will not directly be 'struct msm_gpu *', so add a helper to reduce the churn. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/adreno_device.c | 10 -- drivers/gpu/drm/msm/msm_gpu.c | 6 +++--- drivers/gpu/drm/msm/msm_g

[Freedreno] [PATCH 04/19] iommu/arm-smmu: Prepare for the adreno-smmu implementation

2020-08-13 Thread Rob Clark
From: Jordan Crouse Do a bit of prep work to add the upcoming adreno-smmu implementation. Add an hook to allow the implementation to choose which context banks to allocate. Move some of the common structs to arm-smmu.h in anticipation of them being used by the implementations and update some of

[Freedreno] [PATCH 14/19] drm/msm: Add support to create a local pagetable

2020-08-13 Thread Rob Clark
From: Jordan Crouse Add support to create a io-pgtable for use by targets that support per-instance pagetables. In order to support per-instance pagetables the GPU SMMU device needs to have the qcom,adreno-smmu compatible string and split pagetables enabled. Signed-off-by: Jordan Crouse Signed-

[Freedreno] [PATCH 13/19] drm/msm: Set the global virtual address range from the IOMMU domain

2020-08-13 Thread Rob Clark
From: Jordan Crouse Use the aperture settings from the IOMMU domain to set up the virtual address range for the GPU. This allows us to transparently deal with IOMMU side features (like split pagetables). Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/adre

[Freedreno] [PATCH 17/19] arm: dts: qcom: sm845: Set the compatible string for the GPU SMMU

2020-08-13 Thread Rob Clark
From: Jordan Crouse Set the qcom,adreno-smmu compatible string for the GPU SMMU to enable split pagetables and per-instance pagetables for drm/msm. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[Freedreno] [PATCH 15/19] drm/msm: Add support for private address space instances

2020-08-13 Thread Rob Clark
From: Jordan Crouse Add support for allocating private address space instances. Targets that support per-context pagetables should implement their own function to allocate private address spaces. The default will return a pointer to the global address space. Signed-off-by: Jordan Crouse Signed

[Freedreno] [PATCH 18/19] iommu/arm-smmu: add a way for implementations to influence SCTLR

2020-08-13 Thread Rob Clark
From: Rob Clark For the Adreno GPU's SMMU, we want SCTLR.HUPCF set to ensure that pending translations are not terminated on iova fault. Otherwise a terminated CP read could hang the GPU by returning invalid command-stream data. Signed-off-by: Rob Clark --- drivers/iommu/arm/arm-smmu/arm-smmu

[Freedreno] [PATCH 16/19] drm/msm/a6xx: Add support for per-instance pagetables

2020-08-13 Thread Rob Clark
From: Jordan Crouse Add support for using per-instance pagetables if all the dependencies are available. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 70 +++ drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 + drivers/gpu/

[Freedreno] [PATCH 12/19] drm/msm: Drop context arg to gpu->submit()

2020-08-13 Thread Rob Clark
From: Jordan Crouse Now that we can get the ctx from the submitqueue, the extra arg is redundant. Signed-off-by: Jordan Crouse [split out of previous patch to reduce churny noise] Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 12 +--- drivers/gpu/drm/msm/adren

[Freedreno] [PATCH 19/19] drm/msm: show process names in gem_describe

2020-08-13 Thread Rob Clark
From: Rob Clark In $debugfs/gem we already show any vma(s) associated with an object. Also show process names if the vma's address space is a per-process address space. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_drv.c | 2 +- drivers/gpu/drm/msm/msm_gem.c | 25 ++