[Freedreno] [PATCH v6] drm/msm/a6xx: Add support for an interconnect path

2019-01-18 Thread Jordan Crouse
not yet exist. v6: use icc_set_bw() instead of icc_set() v5: Remove hardcoded interconnect name and just use the default v4: Don't use a port string at all to skip the need for names in the DT v3: Use macros and change port string per Georgi Djakov Signed-off-by: Jordan Crouse --- drivers/gp

Re: [Freedreno] [PATCH v6] drm/msm/a6xx: Add support for an interconnect path

2019-01-18 Thread Jordan Crouse
On Fri, Jan 18, 2019 at 01:24:18PM -0700, Jordan Crouse wrote: > Try to get the interconnect path for the GPU and vote for the maximum > bandwidth to support all frequencies. This is needed for performance. > Later we will want to scale the bandwidth based on the frequency to > also

Re: [Freedreno] [PATCH v6] drm/msm/a6xx: Add support for an interconnect path

2019-01-18 Thread Jordan Crouse
On Fri, Jan 18, 2019 at 01:52:20PM -0800, Doug Anderson wrote: > Hi, > > On Fri, Jan 18, 2019 at 12:24 PM Jordan Crouse wrote: > > > > Try to get the interconnect path for the GPU and vote for the maximum > > bandwidth to support all frequencies. This is needed for per

Re: [Freedreno] [PATCH v6] drm/msm/a6xx: Add support for an interconnect path

2019-01-18 Thread Jordan Crouse
On Fri, Jan 18, 2019 at 03:04:34PM -0800, Evan Green wrote: > On Fri, Jan 18, 2019 at 12:24 PM Jordan Crouse wrote: > > > > Try to get the interconnect path for the GPU and vote for the maximum > > bandwidth to support all frequencies. This is needed for performance. >

[Freedreno] [PATCH v1 3/6] drm/msm/gpu: Attach to the GPU GX power domain

2019-02-04 Thread Jordan Crouse
power domain and does the magic to "enable" and disable it at the right points. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 41 ++- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 2 ++ 2 files changed, 42 insertions(+), 1 deletio

[Freedreno] [PATCH v1 5/6] msm/drm/a6xx: Turn off the GMU if resume fails

2019-02-04 Thread Jordan Crouse
-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 82 +++--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 20 ++-- drivers/gpu/drm/msm/adreno/adreno_device.c | 1 + 3 files changed, 58 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/msm

[Freedreno] [PATCH v1 2/6] dt-bindings: drm/msm/a6xx: Add GX power-domain for GMU bindings

2019-02-04 Thread Jordan Crouse
The GMU should have two power domains defined: "cx" and "gx". "cx" is the actual power domain for the device and "gx" will be attached at runtime to manage reference counting on the GPU device in case of a GMU crash. Signed-off-by: Jordan Crouse --- D

[Freedreno] [PATCH v1 0/6] drm/msm: Improved a6xx GMU reset

2019-02-04 Thread Jordan Crouse
t is today. Jordan Crouse (6): drm/msm/a6xx: Remove unwanted regulator code dt-bindings: drm/msm/a6xx: Add GX power-domain for GMU bindings drm/msm/gpu: Attach to the GPU GX power domain drm/msm/a6xx: Make GMU reset useful msm/drm/a6xx: Turn off the GMU if resume fails drm/msm/a6xx: Remove

[Freedreno] [PATCH v1 6/6] drm/msm/a6xx: Remove an unused struct member

2019-02-04 Thread Jordan Crouse
The HFI tasklet was removed in df0dff1 ("drm/msm/a6xx: Poll for HFI responses") but the tasklet_struct was accidentally left behind. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/

[Freedreno] [PATCH v1 4/6] drm/msm/a6xx: Make GMU reset useful

2019-02-04 Thread Jordan Crouse
Now that the GX domain is sorted we can wire up a working GMU reset. IF a GMU hang was detected then try to forcefully shut down the GMU in the power down sequence which should ensure that it can recover normally on the next power up. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno

[Freedreno] [PATCH v1 1/6] drm/msm/a6xx: Remove unwanted regulator code

2019-02-04 Thread Jordan Crouse
The GMU code currently has some misguided code to try to work around a hardware quirk that requires the power domains on the GPU be collapsed in a certain order. Upcoming patches will do this the right way so get rid of the unused and unwanted regulator code. Signed-off-by: Jordan Crouse

Re: [Freedreno] [PATCH] drm/msm: fix an error code in the ioctl

2019-02-15 Thread Jordan Crouse
On Thu, Feb 14, 2019 at 06:16:01PM -0500, Rob Clark wrote: > On Thu, Feb 14, 2019 at 2:19 AM Dan Carpenter > wrote: > > > > The copy_to/from_user() functions return the number of bytes remaining > > to be copied but we should return -EFAULT to the user. > > > > Fixes: f05c83e77460 ("drm/msm: add

Re: [Freedreno] [PATCH v1 2/6] dt-bindings: drm/msm/a6xx: Add GX power-domain for GMU bindings

2019-02-19 Thread Jordan Crouse
On Sun, Feb 17, 2019 at 05:43:16PM -0500, Rob Clark wrote: > On Sun, Feb 17, 2019 at 4:08 PM Rob Herring wrote: > > > > On Mon, Feb 4, 2019 at 10:15 AM Jordan Crouse > > wrote: > > > > > > The GMU should have two power domains defined: "cx" an

[Freedreno] [PATCH] drm/msm: Truncate the buffer object name if the copy from user failed

2019-02-19 Thread Jordan Crouse
ries/56656/ Fixes: f05c83e77460 ("drm/msm: add uapi to get/set debug name") Reported-by: Dan Carpenter Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm

[Freedreno] [PATCH RESEND] drm/msm: Truncate the buffer object name if the copy from user failed

2019-02-19 Thread Jordan Crouse
] reported and fixed by Dan Carpenter. [1] https://patchwork.freedesktop.org/series/56656/ Fixes: f05c83e77460 ("drm/msm: add uapi to get/set debug name") Reported-by: Dan Carpenter Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c | 5 - 1 file changed, 4 inser

[Freedreno] [PATCH] drm/msm: Remove pm_runtime calls from msm_iommu.c

2019-02-19 Thread Jordan Crouse
hicken and egg problem. Luckily this is easily fixed by removing the pm_runtime calls from the functions and letting the device link to the IOMMU device handle the magic. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_iommu.c | 13 + 1 file changed, 1 insertion(+), 12

[Freedreno] [PATCH] drm/msm: Fix incorrect struct size for memory allocation

2019-02-21 Thread Jordan Crouse
The allocation for the clock bulk data does a classic sizeof(pointer) instead of sizeof(struct) so the array ends up incorrectly sized for the clock data. Cc: sta...@vger.kernel.org Fixes: 8e54eea ("drm/msm: Add a helper function to parse clock names") Signed-off-by: Jordan Crouse ---

[Freedreno] [RFC PATCH v1 03/15] iommu/io-pgtable: Allow TLB operations to be optional

2019-03-01 Thread Jordan Crouse
configuration to be NULL just in case the caller accidentally calls for a flush with the wrong device. Signed-off-by: Jordan Crouse --- drivers/iommu/io-pgtable.h | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/io-pgtable.h b/drivers/iommu/io-pgtable.h

[Freedreno] [RFC PATCH v1 01/15] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2019-03-01 Thread Jordan Crouse
Add a new domain attribute to enable split pagetable support for devices devices that support it. Signed-off-by: Jordan Crouse --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index e90da6b..3f2250b 100644 --- a/include

[Freedreno] [RFC PATCH v1 02/15] iommu/arm-smmu: Add split pagetable support for arm-smmu-v2

2019-03-01 Thread Jordan Crouse
Add support for a split pagetable (TTBR0/TTBR1) scheme for arm-smmu-v2. If split pagetables are enabled, create a pagetable for TTBR1 and set up the sign extension bit so that all IOVAs with that bit set are mapped and translated from the TTBR1 pagetable. Signed-off-by: Jordan Crouse

[Freedreno] [RFC PATCH v1 04/15] iommu: Add DOMAIN_ATTR_PTBASE

2019-03-01 Thread Jordan Crouse
Add an attribute to return the base address of the pagetable. This is used by auxiliary domains from arm-smmu to return the address of the pagetable to the leaf driver so that it can set the appropriate pagetable through it's own means. Signed-off-by: Jordan Crouse --- include/linux/io

[Freedreno] [RFC PATCH v1 00/15] drm/msm: Per-instance pagetable support

2019-03-01 Thread Jordan Crouse
cular, I want to make sure that this fits with the current thinking about how aux domains should look and feel. [1] https://patchwork.freedesktop.org/series/43447/ [2] https://patchwork.kernel.org/patch/10825061/ Jordan Crouse (15): iommu: Add DOMAIN_ATTR_SPLIT_TABLES iommu/arm-smmu: Add

[Freedreno] [RFC PATCH v1 06/15] drm/msm/adreno: Enable 64 bit mode by default on a5xx and a6xx targets

2019-03-01 Thread Jordan Crouse
generating 32 bit addresses so switch over now to prepare for using addresses above 4G for targets that support them. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 14 ++ drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 14 ++ 2 files changed, 28 insertions

[Freedreno] [RFC PATCH v1 05/15] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2019-03-01 Thread Jordan Crouse
u domain to map and unmap iova addresses in the pagetable. The driver/hardware can be used to switch the pagetable according to its own specific implementation. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 135 ++- 1 file changed, 11

[Freedreno] [RFC PATCH v1 08/15] drm/msm: Pass the MMU domain index in struct msm_file_private

2019-03-01 Thread Jordan Crouse
Pass the index of the MMU domain in struct msm_file_private instead of assuming gpu->id throughout the submit path. This clears the way to change ctx->aspace to a per-instance pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c| 2 ++ drivers/gpu/d

[Freedreno] [RFC PATCH v1 11/15] drm/msm: Add a helper function for a per-instance address space

2019-03-01 Thread Jordan Crouse
Add a helper function to create a GEM address space attached to an iommu auxiliary domain for a per-instance pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.h | 4 +++ drivers/gpu/drm/msm/msm_gem_vma.c | 53 +++ 2 files changed

[Freedreno] [RFC PATCH v1 10/15] drm/msm: Add support for IOMMU auxiliary domains

2019-03-01 Thread Jordan Crouse
Add support for creating a auxiliary domain from the IOMMU device to implement per-instance pagetables. Also add a helper function to return the pagetable base address (ttbr) and asid to the caller so that the GPU target code can set up the pagetable switch. Signed-off-by: Jordan Crouse

[Freedreno] [RFC PATCH v1 07/15] drm/msm: Print all 64 bits of the faulting IOMMU address

2019-03-01 Thread Jordan Crouse
When we move to 64 bit addressing for a5xx and a6xx targets we will start seeing pagefaults at larger addresses so format them appropriately in the log message for easier debugging. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1

[Freedreno] [RFC PATCH v1 09/15] drm/msm/gpu: Move address space setup to the GPU targets

2019-03-01 Thread Jordan Crouse
some of the target files but I think it pays for itself in improved code flow and flexibility. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 37 -- drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 50 ++ drivers/gpu/drm/msm

[Freedreno] [RFC PATCH v1 15/15] drm/msm/a5xx: Support per-instance pagetables

2019-03-01 Thread Jordan Crouse
. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 120 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.h | 19 + drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 70 + 3 files changed, 192 insertions(+), 17 deletions(-) diff

[Freedreno] [RFC PATCH v1 14/15] drm/msm/a6xx: Support per-instance pagetables

2019-03-01 Thread Jordan Crouse
Add support for per-instance pagetables for a6xx targets. Add support to handle split pagetables and create a new instance if the needed IOMMU support exists and insert the necessary PM4 commands to trigger a pagetable switch at the beginning of a user command. Signed-off-by: Jordan Crouse

[Freedreno] [RFC PATCH v1 12/15] drm/msm: Add support to create target specific address spaces

2019-03-01 Thread Jordan Crouse
Add support to create a GPU target specific address space for a context. For those targets that support per-instance pagetables they will return a new address space set up for the instance if possible otherwise just use the global device pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu

[Freedreno] [RFC PATCH v1 13/15] drm/msm/gpu: Add ttbr0 to the memptrs

2019-03-01 Thread Jordan Crouse
Targets that support per-instance pagetable switching will have to keep track of which pagetable belongs to each instance to be able to recover for preemption. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_ringbuffer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu

[Freedreno] [PATCH v1 0/4] drm/msm/a6xx: Add support for zap shader

2019-03-12 Thread Jordan Crouse
he final two patches add the DT bindings and DT settings for setting up the reserved memory that the shader requires. Jordan Crouse (4): drm/msm/gpu: Move zap shader loading to adreno drm/msm/a6xx: Add zap shader load dt-bindings: drm/msm/gpu: Document a5xx / a6xx zap shader region arm64:

[Freedreno] [PATCH v1 2/4] drm/msm/a6xx: Add zap shader load

2019-03-12 Thread Jordan Crouse
M sequence this should fail and we would fall back to writing the register. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 38 +- drivers/gpu/drm/msm/adreno/adreno_device.c | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) di

[Freedreno] [PATCH v1 1/4] drm/msm/gpu: Move zap shader loading to adreno

2019-03-12 Thread Jordan Crouse
a5xx and a6xx both share (mostly) the same code to load the zap shader and bring the GPU out of secure mode. Move the formerly 5xx specific code to adreno to make it available for a6xx too. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 109

[Freedreno] [PATCH v1 3/4] dt-bindings: drm/msm/gpu: Document a5xx / a6xx zap shader region

2019-03-12 Thread Jordan Crouse
Describe the zap-shader node that defines a reserved memory region to store the zap shader. Signed-off-by: Jordan Crouse --- Documentation/devicetree/bindings/display/msm/gpu.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/display/msm/gpu.txt b

[Freedreno] [PATCH v1 4/4] arm64: dts: sdm845: Add zap shader region for GPU

2019-03-12 Thread Jordan Crouse
Some Adreno GPU targets require a special zap shader to bring the GPU out of secure mode. Define a region to allocate and store the zap shader. Signed-off-by: Jordan Crouse --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot

Re: [Freedreno] [RFC PATCH v1 04/15] iommu: Add DOMAIN_ATTR_PTBASE

2019-03-18 Thread Jordan Crouse
On Mon, Mar 18, 2019 at 10:53:21AM +0100, Joerg Roedel wrote: > On Fri, Mar 01, 2019 at 12:38:26PM -0700, Jordan Crouse wrote: > > Add an attribute to return the base address of the pagetable. This is used > > by auxiliary domains from arm-smmu to return the address of the paget

[Freedreno] [PATCH v2] drm/msm/gpu: Add submit queue queries

2019-03-22 Thread Jordan Crouse
is responsible for any and if so it can invalidate itself. This is also helpful for testing by confirming to the user driver if a particular command stream caused a fault (or not as the case may be). Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c | 9 +++- drivers

Re: [Freedreno] [PATCH v1 3/4] dt-bindings: drm/msm/gpu: Document a5xx / a6xx zap shader region

2019-04-01 Thread Jordan Crouse
On Thu, Mar 28, 2019 at 08:32:15AM -0500, Rob Herring wrote: > On Tue, Mar 12, 2019 at 12:13:41PM -0600, Jordan Crouse wrote: > > Describe the zap-shader node that defines a reserved memory region > > to store the zap shader. > > > > Signed-off-by: Jordan Crouse >

Re: [Freedreno] [PATCH] drm/msm/a6xx: Fix build with !CONFIG_DEBUG_FS

2019-04-03 Thread Jordan Crouse
On Wed, Apr 03, 2019 at 02:48:11PM +0800, Yue Haibing wrote: > From: YueHaibing > > When building CONFIG_DEBUG_FS is not set > gcc warn this: > > drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c: In function a6xx_show: > drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c:1124:2: error: implicit > declarati

Re: [Freedreno] [PATCH 3/7] drm/msm: a5xx: fix possible object reference leak

2019-04-10 Thread Jordan Crouse
remented on line 51, but without a > corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Rob Clark > Cc: Sean Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: Jordan Crouse > Cc: Mamta Shukla > Cc: Thomas Zimmermann >

[Freedreno] [PATCH] drm/msm/a6xx: Don't enable GPU state code if dependencies are missing

2019-04-10 Thread Jordan Crouse
Add CONFIG_DRM_MSM_GPU_STATE to conditionally compile Adreno GPU state code depending on the availability of the dependencies. Reported-by: Hulk Robot Reported-by: YueHaibing Fixes: 1707add81551 ("drm/msm/a6xx: Add a6xx gpu state") Signed-off-by: Jordan Crouse --- drivers/gpu/drm/m

Re: [Freedreno] [PATCH] drm/msm/a6xx: Fix build with !CONFIG_DEBUG_FS

2019-04-10 Thread Jordan Crouse
On Thu, Apr 04, 2019 at 10:02:07AM +0800, YueHaibing wrote: > On 2019/4/3 23:36, Jordan Crouse wrote: > > On Wed, Apr 03, 2019 at 02:48:11PM +0800, Yue Haibing wrote: > >> From: YueHaibing > >> > >> When building CONFIG_DEBUG_FS is not set > >> gcc wa

Re: [Freedreno] [PATCH 2/3] drm/msm: add param to retrieve # of GPU faults (global)

2019-04-19 Thread Jordan Crouse
ch provides the latter. > > Signed-off-by: Rob Clark Reviewed-by: Jordan Crouse > --- > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 3 +++ > drivers/gpu/drm/msm/msm_gpu.c | 3 +++ > drivers/gpu/drm/msm/msm_gpu.h | 3 +++ > include/uapi/drm/msm_drm.h

Re: [Freedreno] [PATCH 1/3] drm/msm/gpu: add per-process pagetables param

2019-04-19 Thread Jordan Crouse
e an informed decision about exposing > KHR_robustness. > > Signed-off-by: Rob Clark Reviewed-by: Jordan Crouse > --- > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 3 +++ > include/uapi/drm/msm_drm.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git

[Freedreno] [PATCH v2 2/3] drm/msm/a6xx: Add zap shader load

2019-04-19 Thread Jordan Crouse
M sequence this should fail and we would fall back to writing the register. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 38 +- drivers/gpu/drm/msm/adreno/adreno_device.c | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) di

[Freedreno] [PATCH v2 0/3] drm/msm/a6xx: Add support for zap shader

2019-04-19 Thread Jordan Crouse
he final two patches add the DT bindings and DT settings for setting up the reserved memory that the shader requires. v2: Reduced the redundant log messages for targets that don't need the zap shader Jordan Crouse (3): drm/msm/gpu: Move zap shader loading to adreno drm/msm/a6xx: Add zap

[Freedreno] [PATCH v2 1/3] drm/msm/gpu: Move zap shader loading to adreno

2019-04-19 Thread Jordan Crouse
a5xx and a6xx both share (mostly) the same code to load the zap shader and bring the GPU out of secure mode. Move the formerly 5xx specific code to adreno to make it available for a6xx too. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 111

[Freedreno] [PATCH v2 3/3] dt-bindings: drm/msm/gpu: Document a5xx / a6xx zap shader region

2019-04-19 Thread Jordan Crouse
Describe the zap-shader node that defines a reserved memory region to store the zap shader. Signed-off-by: Jordan Crouse --- Documentation/devicetree/bindings/display/msm/gpu.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/display/msm/gpu.txt b

[Freedreno] [PATCH v4] dt-bindings: drm/msm/a6xx: Document interconnect properties for GPU

2019-04-19 Thread Jordan Crouse
Add documentation for the interconnect and interconnect-names bindings for the GPU node as detailed by bindings/interconnect/interconnect.txt. Signed-off-by: Jordan Crouse Reviewed-by: Douglas Anderson Reviewed-by: Rob Herring Acked-by: Georgi Djakov --- v4: Fix spelling nits per Georgi

[Freedreno] [PATCH v1 2/3] drm/msm: Print all 64 bits of the faulting IOMMU address

2019-05-07 Thread Jordan Crouse
When we move to 64 bit addressing for a5xx and a6xx targets we will start seeing pagefaults at larger addresses so format them appropriately in the log message for easier debugging. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1

[Freedreno] [PATCH v1 3/3] drm/msm: Pass the MMU domain index in struct msm_file_private

2019-05-07 Thread Jordan Crouse
Pass the index of the MMU domain in struct msm_file_private instead of assuming gpu->id throughout the submit path. This clears the way to change ctx->aspace to a per-instance pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c| 2 ++ drivers/gpu/d

[Freedreno] [PATCH v1 0/3] drm/msm: Add dependencies for per-instance pagetables

2019-05-07 Thread Jordan Crouse
These are a few support changes in advance of per-instance pagetables. These can be added to msm-next immediately since they don't require anything external support and they are mostly benign on their own without the more aggressive changes coming up later. Jordan Crouse (3): drm/msm/a

[Freedreno] [PATCH v1 1/3] drm/msm/adreno: Enable 64 bit mode by default on a5xx and a6xx targets

2019-05-07 Thread Jordan Crouse
generating 32 bit addresses so switch over now to prepare for using addresses above 4G on targets that support them. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 14 ++ drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 14 ++ 2 files changed, 28 insertions

[Freedreno] [PATCH] drm/atomic: Check that the config funcs exist drm_mode_alloc

2019-05-07 Thread Jordan Crouse
An error while initializing the msm driver ends up calling drm_atomic_helper_shutdown() without first initializing the funcs in mode_config. While I'm not 100% sure this isn't a ordering problem in msm adding a check to drm_mode_alloc seems like a nice and safe solution. Signed-off-

[Freedreno] [PATCH 3/3] drm/msm/adreno: Call pm_runtime_force_suspend() during unbind

2019-05-07 Thread Jordan Crouse
d, in the case of the GMU). Instead of calling the pm_suspend function directly, use pm_runtime_force_suspend() which should check the correct state of runtime and call the functions on our behalf or skip them if they are not needed. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/a

[Freedreno] [PATCH 1/3] drm/msm/dpu: Fix error recovery after failing to enable clocks

2019-05-07 Thread Jordan Crouse
just failed to prepare/enable. Skip the current failed clock during the unwind to to avoid the extra log spew. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_ut

[Freedreno] [PATCH 0/3] drm/msm: Handle component bind failures a bit better

2019-05-07 Thread Jordan Crouse
I somewhat accidently injected an error in the DPU KMS init that caused it to fail and a handful of NULL deferences and errors ended up popping out. Here are some fixes in the interest of robustness. Jordan Crouse (3): drm/msm/dpu: Fix error recovery after failing to enable clocks drm/msm/dpu

[Freedreno] [PATCH 2/3] drm/msm/dpu: Avoid a null de-ref while recovering from kms init fail

2019-05-07 Thread Jordan Crouse
In the failure path for dpu_kms_init() it is possible to get to the MMU destroy function with uninitialized MMU structs. Check for NULl and skip if needed. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions

Re: [Freedreno] [PATCH] drm/msm/a6xx: No zap shader is not an error

2019-05-08 Thread Jordan Crouse
y* handled, but missed > clearing 'ret' resulting that hw_init() returned an error on these > devices. > > Fixes: abccb9fe3267 drm/msm/a6xx: Add zap shader load > Signed-off-by: Rob Clark Woo, I'm glad we finally got a chance to verify this on both types of systems. Acked

Re: [Freedreno] [PATCH] drm/msm: Upgrade gxpd checks to IS_ERR_OR_NULL

2019-05-15 Thread Jordan Crouse
power domain") > Cc: Jordan Crouse > Cc: Rob Clark > Signed-off-by: Sean Paul Reviewed-by: Jordan Crouse > --- > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx

Re: [Freedreno] [PATCH 1/4] drm/msm: Fix improper uses of smp_mb__{before, after}_atomic()

2019-05-20 Thread Jordan Crouse
mplement preemption for A5XX targets") > Cc: sta...@vger.kernel.org > Reported-by: "Paul E. McKenney" > Reported-by: Peter Zijlstra > Signed-off-by: Andrea Parri > Cc: Rob Clark > Cc: Sean Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc

[Freedreno] [PATCH v2 00/15] drm/msm: Per-instance pagetable support

2019-05-21 Thread Jordan Crouse
and drm/msm: Add support to create target specific address spaces can be merged to the msm-next tree without dependencies on the IOMMU changes. Only the last three patches will require coordination between the two areas. Jordan Crouse (15): iommu/arm-smmu: Allow IOMMU enabled devices to ski

[PATCH v2 02/15] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2019-05-21 Thread Jordan Crouse
Add a new domain attribute to enable split pagetable support for devices devices that support it. Signed-off-by: Jordan Crouse --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 4ef8bd5..204acd8 100644 --- a/include

[Freedreno] [PATCH v2 01/15] iommu/arm-smmu: Allow IOMMU enabled devices to skip DMA domains

2019-05-21 Thread Jordan Crouse
domain of its own. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 42 ++ drivers/iommu/iommu.c| 29 +++-- include/linux/iommu.h| 3 +++ 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/drivers

[PATCH v2 05/15] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2019-05-21 Thread Jordan Crouse
map and unmap iova addresses in the pagetable. The driver/hardware is used to switch the pagetable according to its own specific implementation. Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c | 133 +-- 1 file changed, 117 insertions(+), 16

[Freedreno] [PATCH v2 06/15] drm/msm/adreno: Enable 64 bit mode by default on a5xx and a6xx targets

2019-05-21 Thread Jordan Crouse
generating 32 bit addresses so switch over now to prepare for using addresses above 4G for targets that support them. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 14 ++ drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 14 ++ 2 files changed, 28 insertions

[Freedreno] [PATCH v2 03/15] iommu/arm-smmu: Add split pagetable support for arm-smmu-v2

2019-05-21 Thread Jordan Crouse
Add support for a split pagetable (TTBR0/TTBR1) scheme for arm-smmu-v2. If split pagetables are enabled, create a pagetable for TTBR1 and set up the sign extension bit so that all IOVAs with that bit set are mapped and translated from the TTBR1 pagetable. Signed-off-by: Jordan Crouse

[Freedreno] [PATCH v2 04/15] iommu: Add DOMAIN_ATTR_PTBASE

2019-05-21 Thread Jordan Crouse
Add an attribute to return the base address of the pagetable. This is used by auxiliary domains from arm-smmu to return the address of the pagetable to the leaf driver so that it can set the appropriate pagetable through it's own means. Signed-off-by: Jordan Crouse --- include/linux/io

[Freedreno] [PATCH v2 07/15] drm/msm: Print all 64 bits of the faulting IOMMU address

2019-05-21 Thread Jordan Crouse
When we move to 64 bit addressing for a5xx and a6xx targets we will start seeing pagefaults at larger addresses so format them appropriately in the log message for easier debugging. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1

[Freedreno] [PATCH v2 15/15] drm/msm/a5xx: Support per-instance pagetables

2019-05-21 Thread Jordan Crouse
. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 120 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.h | 19 + drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 70 + 3 files changed, 192 insertions(+), 17 deletions(-) diff

[Freedreno] [PATCH v2 10/15] drm/msm: Add a helper function for a per-instance address space

2019-05-21 Thread Jordan Crouse
Add a helper function to create a GEM address space attached to an iommu auxiliary domain for a per-instance pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.h | 4 +++ drivers/gpu/drm/msm/msm_gem_vma.c | 53 +++ 2 files changed

[Freedreno] [PATCH v2 08/15] drm/msm: Pass the MMU domain index in struct msm_file_private

2019-05-21 Thread Jordan Crouse
Pass the index of the MMU domain in struct msm_file_private instead of assuming gpu->id throughout the submit path. This clears the way to change ctx->aspace to a per-instance pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.c| 2 ++ drivers/gpu/d

[Freedreno] [PATCH v2 13/15] drm/msm: Add support for IOMMU auxiliary domains

2019-05-21 Thread Jordan Crouse
Add support for creating a auxiliary domain from the IOMMU device to implement per-instance pagetables. Also add a helper function to return the pagetable base address (ttbr) and asid to the caller so that the GPU target code can set up the pagetable switch. Signed-off-by: Jordan Crouse

[Freedreno] [PATCH v2 12/15] drm/msm: Add support to create target specific address spaces

2019-05-21 Thread Jordan Crouse
Add support to create a GPU target specific address space for a context. For those targets that support per-instance pagetables they will return a new address space set up for the instance if possible otherwise just use the global device pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu

[Freedreno] [PATCH v2 09/15] drm/msm/gpu: Move address space setup to the GPU targets

2019-05-21 Thread Jordan Crouse
some of the target files but I think it pays for itself in improved code flow and flexibility. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 37 -- drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 50 ++ drivers/gpu/drm/msm

[Freedreno] [PATCH v2 11/15] drm/msm/gpu: Add ttbr0 to the memptrs

2019-05-21 Thread Jordan Crouse
Targets that support per-instance pagetable switching will have to keep track of which pagetable belongs to each instance to be able to recover for preemption. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_ringbuffer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu

[Freedreno] [PATCH v2 14/15] drm/msm/a6xx: Support per-instance pagetables

2019-05-21 Thread Jordan Crouse
Add support for per-instance pagetables for a6xx targets. Add support to handle split pagetables and create a new instance if the needed IOMMU support exists and insert the necessary PM4 commands to trigger a pagetable switch at the beginning of a user command. Signed-off-by: Jordan Crouse

Re: [PATCH v2 01/15] iommu/arm-smmu: Allow IOMMU enabled devices to skip DMA domains

2019-05-21 Thread Jordan Crouse
On Tue, May 21, 2019 at 06:43:34PM +0100, Robin Murphy wrote: > On 21/05/2019 17:13, Jordan Crouse wrote: > >Allow IOMMU enabled devices specified on an opt-in list to create a > >default identity domain for a new IOMMU group and bypass the DMA > >domain created by the IOMMU

Re: [Freedreno] [PATCH v2 03/15] iommu/arm-smmu: Add split pagetable support for arm-smmu-v2

2019-05-23 Thread Jordan Crouse
On Tue, May 21, 2019 at 07:18:32PM +0100, Robin Murphy wrote: > On 21/05/2019 17:13, Jordan Crouse wrote: > >Add support for a split pagetable (TTBR0/TTBR1) scheme for arm-smmu-v2. > >If split pagetables are enabled, create a pagetable for TTBR1 and set > >up the sign exte

Re: [Freedreno] [PATCH v2 1/6] drm/msm/a6xx: Avoid freeing gmu resources multiple times

2019-05-23 Thread Jordan Crouse
et on > successful probe and cleared on removal. > > Changes in v2: > - None > > Cc: Jordan Crouse > Signed-off-by: Sean Paul Reviewed-by: Jordan Crouse > --- > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 14 +- > drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 1 +

Re: [Freedreno] [PATCH v2 2/6] drm/msm/a6xx: Remove duplicate irq disable from remove

2019-05-23 Thread Jordan Crouse
he irqs_enabled flag > it's just housekeeping. > > Changes in v2: > - None > > Cc: Jordan Crouse > Signed-off-by: Sean Paul Reviewed-by: Jordan Crouse > --- > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git

Re: [Freedreno] [PATCH v2 3/6] drm/msm/a6xx: Check for ERR or NULL before iounmap

2019-05-23 Thread Jordan Crouse
On Thu, May 23, 2019 at 01:16:42PM -0400, Sean Paul wrote: > From: Sean Paul > > pdcptr and seqptr aren't necessarily valid, check them before trying to > unmap them. > > Changes in v2: > - None > > Cc: Jordan Crouse > Signed-off-by: Sean Paul It has alway

Re: [Freedreno] [PATCH v2 4/6] drm/msm/a6xx: Remove devm calls from gmu driver

2019-05-23 Thread Jordan Crouse
In the case of irqs, this causes failures since the irqs are > not shared (nor should they be). > > This patch removes all devm_* calls and manually cleans things up in > gmu_remove. > > Changes in v2: > - Add iounmap and free_irq to gmu_probe error paths > > Cc: Jordan

Re: [Freedreno] [PATCH v2 5/6] drm/msm/a6xx: Drop the device reference in gmu

2019-05-23 Thread Jordan Crouse
On Thu, May 23, 2019 at 01:16:44PM -0400, Sean Paul wrote: > From: Sean Paul > > of_find_device_by_node() grabs a dev reference, so make sure we clear it > on error and remove. > > Changes in v2: > - Added to the set (Jordan) > > Cc: Jordan Crouse > Signed-o

Re: [Freedreno] [PATCH v2 6/6] drm/msm/a6xx: Rename a6xx_gmu_probe to a6xx_gmu_init

2019-05-23 Thread Jordan Crouse
or reasons laid > out in the previous patch). > > Changes in v2: > - None > > Cc: Jordan Crouse > Signed-off-by: Sean Paul Reviewed-by: Jordan Crouse > --- > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +- > drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- > drivers

Re: [Freedreno] [PATCH v2] drm/msm/dpu: Use provided drm_minor to initialize debugfs

2019-05-28 Thread Jordan Crouse
On Tue, May 28, 2019 at 11:13:39AM -0400, Sean Paul wrote: > From: Sean Paul > > Instead of reaching into dev->primary for debugfs_root, use the minor > passed into debugfs_init. > > This avoids creating a debug directory under /sys/kernel/debug/debug > and instead uses /sys/kernel/debug/dri// >

Re: [Freedreno] [PATCH] drm/msm/dpu: Remove bogus comment

2019-05-28 Thread Jordan Crouse
On Tue, May 28, 2019 at 02:26:45PM -0400, Sean Paul wrote: > From: Sean Paul > > This comment doesn't make any sense, remove it. > > Suggested-by: Jordan Crouse > Signed-off-by: Sean Paul > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 1 - > 1 file cha

Re: [Freedreno] [PATCH] drm/msm/adreno: Add A540 support

2019-05-28 Thread Jordan Crouse
On Tue, May 28, 2019 at 10:06:12AM -0700, Jeffrey Hugo wrote: > The A540 is a derivative of the A530, and is found in the MSM8998 SoC. > > Signed-off-by: Jeffrey Hugo > --- > drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 22 +++ > drivers/gpu/drm/msm/adreno/a5xx_power.c| 76 ++

[Freedreno] [PATCH v3 01/16] iommu/arm-smmu: Allow client devices to select direct mapping

2019-05-29 Thread Jordan Crouse
: Jordan Crouse --- drivers/iommu/arm-smmu.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 5e54cc0..7537639 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1235,6 +1235,35

[PATCH v3 04/16] iommu/arm-smmu: Add support for DOMAIN_ATTR_SPLIT_TABLES

2019-05-29 Thread Jordan Crouse
If DOMAIN_ATTR_SPLIT_TABLES is specified for a domain pass ARM_64_LPAE_SPLIT_S1 to io_pgtable_ops to allocate and initialize TTBR0 and TTBR1 pagetables. v3: Moved all the pagetable specific work into io-pgtable-arm in previous patch Signed-off-by: Jordan Crouse --- drivers/iommu/arm-smmu.c

[Freedreno] [PATCH v3 03/16] iommu/io-pgtable-arm: Add support for AARCH64 split pagetables

2019-05-29 Thread Jordan Crouse
the correct pagetable is selected based on the incoming iova but most of the heavy lifting is common. v3: New patch taking most of the TTBR1 specific code out of arm-smmu Signed-off-by: Jordan Crouse --- drivers/iommu/io-pgtable-arm.c | 261 + drivers

[PATCH v3 05/16] iommu: Add DOMAIN_ATTR_PTBASE

2019-05-29 Thread Jordan Crouse
Add an attribute to return the base address of the pagetable. This is used by auxiliary domains from arm-smmu to return the address of the pagetable to the leaf driver so that it can set the appropriate pagetable through it's own means. Signed-off-by: Jordan Crouse --- include/linux/io

[Freedreno] [PATCH v3 06/16] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2019-05-29 Thread Jordan Crouse
in to map and unmap iova addresses in the pagetable. The driver/hardware is used to switch the pagetable according to its own specific implementation. v3: Trivial update to reflect new pgtable ops situation Signed-off-by: Jordan Crouse --- drivers/iom

[Freedreno] [PATCH v3 12/16] drm/msm: Add a helper function for a per-instance address space

2019-05-29 Thread Jordan Crouse
Add a helper function to create a GEM address space attached to an iommu auxiliary domain for a per-instance pagetable. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_drv.h | 4 +++ drivers/gpu/drm/msm/msm_gem_vma.c | 53 +++ 2 files changed

[PATCH v3 02/16] iommu: Add DOMAIN_ATTR_SPLIT_TABLES

2019-05-29 Thread Jordan Crouse
Add a new domain attribute to enable split pagetable support for devices devices that support it. Signed-off-by: Jordan Crouse --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index a815cf6..a2f07cf 100644 --- a/include

[Freedreno] [PATCH v3 00/16] drm/msm: Per-instance pagetable support

2019-05-29 Thread Jordan Crouse
areas. Jordan Crouse (16): iommu/arm-smmu: Allow client devices to select direct mapping iommu: Add DOMAIN_ATTR_SPLIT_TABLES iommu/io-pgtable-arm: Add support for AARCH64 split pagetables iommu/arm-smmu: Add support for DOMAIN_ATTR_SPLIT_TABLES iommu: Add DOMAIN_ATTR_PTBASE iommu/arm-smmu

[Freedreno] [PATCH v3 08/16] drm/msm: Print all 64 bits of the faulting IOMMU address

2019-05-29 Thread Jordan Crouse
When we move to 64 bit addressing for a5xx and a6xx targets we will start seeing pagefaults at larger addresses so format them appropriately in the log message for easier debugging. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1

<    1   2   3   4   5   6   7   8   9   10   >