Ganesan, Aravind | 31 Oct 03:33 2014

[PATCH] drm/msm: Don't split an IB at the end of ring buffer.

Splitting the command sequence for an IB1 submission at the end of
the ring buffer can hang the GPU.  To fix this, if there isn't
enough contiguous space at the end to fit the full command sequence,
insert NOPs at the end, and write the sequence at the start, as space
becomes available.

Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
Resend in patch-set format and with dri-devel <at> lists.freedesktop.org on
the CC.
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 45
++++++++++++++++++++++++++++++---
 drivers/gpu/drm/msm/adreno/adreno_gpu.h |  8 +++---
 2 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 1fe7c8d..51901df 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
 <at>  <at>  -281,10 +281,49  <at>  <at>  static uint32_t ring_freewords(struct msm_gpu *gpu)
 	return (rptr + (size - 1) - wptr) % size;
 }

-void adreno_wait_ring(struct msm_gpu *gpu, uint32_t ndwords)
+void adreno_wait_ring_contiguous(struct msm_gpu *gpu,
+		uint32_t ndwords)
 {
-	if (spin_until(ring_freewords(gpu) >= ndwords))
-		DRM_ERROR("%s: timeout waiting for ringbuffer space\n", gpu->name);
(Continue reading)

Ganesan, Aravind | 31 Oct 03:33 2014

[PATCH 3/3] drm/msm: a4xx support for msm-drm

Added a4xx GPU support.

Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
Resend in patch-set format and with dri-devel <at> lists.freedesktop.org on
the CC.
 drivers/gpu/drm/msm/Makefile               |   1 +
 drivers/gpu/drm/msm/adreno/a4xx_gpu.c      | 620
+++++++++++++++++++++++++++++
 drivers/gpu/drm/msm/adreno/a4xx_gpu.h      |  34 ++
 drivers/gpu/drm/msm/adreno/adreno_device.c |  13 +
 drivers/gpu/drm/msm/adreno/adreno_gpu.c    |   2 +-
 drivers/gpu/drm/msm/adreno/adreno_gpu.h    |  14 +-
 6 files changed, 681 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx_gpu.c
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx_gpu.h

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 20b7eda..21020f9 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
 <at>  <at>  -7,6 +7,7  <at>  <at>  msm-y := \
 	adreno/adreno_device.o \
 	adreno/adreno_gpu.o \
 	adreno/a3xx_gpu.o \
+	adreno/a4xx_gpu.o \
 	hdmi/hdmi.o \
 	hdmi/hdmi_audio.o \
 	hdmi/hdmi_bridge.o \
diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
(Continue reading)

Ganesan, Aravind | 31 Oct 03:33 2014

[PATCH 2/3] drm/msm: Handle register offset differences between a3xx, and a4xx

Register offsets have changed between a3xx and a4xx GPUs.
To be able access these registers in common code, we create
a lookup table, and set of read-write APIs to access the
register through the lookup table.

Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
Resend in patch-set format and with dri-devel <at> lists.freedesktop.org on
the CC.
 drivers/gpu/drm/msm/adreno/a3xx_gpu.c   | 103 +++++++++++++++++++++++++
 drivers/gpu/drm/msm/adreno/adreno_gpu.c |  17 +++--
 drivers/gpu/drm/msm/adreno/adreno_gpu.h | 130
++++++++++++++++++++++++++++++++
 3 files changed, 244 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
index 6c4a91a..9713aef9 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
 <at>  <at>  -2,6 +2,8  <at>  <at> 
  * Copyright (C) 2013 Red Hat
  * Author: Rob Clark <robdclark <at> gmail.com>
  *
+ * Copyright (c) 2014 The Linux Foundation. All rights reserved.
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as
published by
  * the Free Software Foundation.
(Continue reading)

Ganesan, Aravind | 31 Oct 03:33 2014

[PATCH 1/3] drm/msm: Additional definitions for a3xx and a4xx

Updated a3xx and a4xx headers, generated from rnndb files:
https://github.com/freedreno/envytools


Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
Resend in patch-set format and with dri-devel <at> lists.freedesktop.org on
the CC.
 drivers/gpu/drm/msm/adreno/a3xx.xml.h |   50 +-
 drivers/gpu/drm/msm/adreno/a4xx.xml.h | 2062
+++++++++++++++++++++++++++++++++
 2 files changed, 2102 insertions(+), 10 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx.xml.h

diff --git a/drivers/gpu/drm/msm/adreno/a3xx.xml.h
b/drivers/gpu/drm/msm/adreno/a3xx.xml.h
index 303e8a9..4bcbfab 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx.xml.h
+++ b/drivers/gpu/drm/msm/adreno/a3xx.xml.h
 <at>  <at>  -8,13 +8,13  <at>  <at>  http://github.com/freedreno/envytools/
 git clone https://github.com/freedreno/envytools.git

 The rules-ng-ng source files this header was generated from are:
-- /home/robclark/src/freedreno/envytools/rnndb/adreno.xml
 (    364 bytes, from 2013-11-30 14:47:15)
-- /home/robclark/src/freedreno/envytools/rnndb/freedreno_copyright.xml
 (   1453 bytes, from 2013-03-31 16:51:27)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/a2xx.xml
 (  32901 bytes, from 2014-06-02 15:21:30)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_common.xml
(Continue reading)

Ganesan, Aravind | 31 Oct 03:33 2014

[PATCH 0/3] drm/msm: Adreno 4xx support

A set of three patches to support adreno 4xx GPUs in msm-drm:
(1) Updated the a3xx and a4xx header files.
(2) Handle register offset differences between a3xx and a4xx GPUs.
(3) Added a4xx GPU support.

Aravind Ganesan (3):
  drm/msm: Additional definitions for a3xx and a4xx
  drm/msm: Handle register offset differences between a3xx and a4xx
  drm/msm: a4xx support for msm-drm

 drivers/gpu/drm/msm/Makefile               |    1 +
 drivers/gpu/drm/msm/adreno/a3xx.xml.h      |   50 +-
 drivers/gpu/drm/msm/adreno/a3xx_gpu.c      |  103 ++
 drivers/gpu/drm/msm/adreno/a4xx.xml.h      | 2062
++++++++++++++++++++++++++++
 drivers/gpu/drm/msm/adreno/a4xx_gpu.c      |  620 +++++++++
 drivers/gpu/drm/msm/adreno/a4xx_gpu.h      |   34 +
 drivers/gpu/drm/msm/adreno/adreno_device.c |   13 +
 drivers/gpu/drm/msm/adreno/adreno_gpu.c    |   19 +-
 drivers/gpu/drm/msm/adreno/adreno_gpu.h    |  140 ++
 9 files changed, 3025 insertions(+), 17 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx.xml.h
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx_gpu.c
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx_gpu.h

-- 
1.8.5.2

--

-- 
Qualcomm Innovation Center, Inc.
(Continue reading)

Gilad Avidov | 30 Oct 23:59 2014

[PATCH 0/1] Compact interface for Device-Tree


Device-Tree compact API
------------------------

Common code seen in driver’s probe reads device tree values and handling
erroneous return codes from all those of_property_read_xxx()  APIs. This
common code is factored out by the of_property_map module which allows
driver’s probe to replace that (often lengthy) code with a concise table:

struct of_prop_map map[] = {
    {"i2c",            &dev->id,        OF_REQ,  OF_ID,  -1},
    {"qcom,clk-freq-out",    &dev->clk_freq_out,    OF_REQ,  OF_U32,  0},
    {"qcom,clk-freq-in",    &dev->clk_freq_in,    OF_REQ,  OF_U32,  0},
    {"qcom,disable-dma",    &dev->disable_dma,    OF_OPT,  OF_BOOL, 0},
    {"qcom,master-id",    &dev->mstr_id,        OF_SGST, OF_U32,  0},
    {NULL,            NULL,            0,       0,       0},
};

Then call populate to read the values into the device’s variables:

ret = of_prop_populate(dev, dev->of_node, map);

An equivalent code snippet using the traditional of_property_read_XXXX()
API. Note that the equivalent is longer and more difficult to follow and
debug:

/* optional property */
dev->disable_dma = of_property_read_bool(node, "qcom,disable-dma");

ret = of_property_read_u32(dev->node, "qcom,clk-freq-out", &dev->clk_freq_out);
(Continue reading)

Ganesan, Aravind | 30 Oct 22:12 2014

[PATCH] drm/msm: Don't split an IB at the end of ring buffer

Splitting the command sequence for an IB1 submission at the end of
the ring buffer can hang the GPU.  To fix this, if there isn't
enough contiguous space at the end to fit the full command sequence,
insert NOPs at the end, and write the sequence at the start, as space
becomes available.

Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 45
++++++++++++++++++++++++++++++---
 drivers/gpu/drm/msm/adreno/adreno_gpu.h |  8 +++---
 2 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 1fe7c8d..51901df 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
 <at>  <at>  -281,10 +281,49  <at>  <at>  static uint32_t ring_freewords(struct msm_gpu *gpu)
 	return (rptr + (size - 1) - wptr) % size;
 }

-void adreno_wait_ring(struct msm_gpu *gpu, uint32_t ndwords)
+void adreno_wait_ring_contiguous(struct msm_gpu *gpu,
+		uint32_t ndwords)
 {
-	if (spin_until(ring_freewords(gpu) >= ndwords))
-		DRM_ERROR("%s: timeout waiting for ringbuffer space\n", gpu->name);
+	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
+	uint32_t size = gpu->rb->size/4;
(Continue reading)

Ganesan, Aravind | 30 Oct 22:12 2014

[PATCH] drm/msm: a4xx support for msm-drm

Added a4xx GPU support.

Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
 drivers/gpu/drm/msm/Makefile               |   1 +
 drivers/gpu/drm/msm/adreno/a4xx_gpu.c      | 619
+++++++++++++++++++++++++++++
 drivers/gpu/drm/msm/adreno/a4xx_gpu.h      |  34 ++
 drivers/gpu/drm/msm/adreno/adreno_device.c |  13 +
 drivers/gpu/drm/msm/adreno/adreno_gpu.c    |   2 +-
 drivers/gpu/drm/msm/adreno/adreno_gpu.h    |  14 +-
 6 files changed, 680 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx_gpu.c
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx_gpu.h

diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
index 20b7eda..21020f9 100644
--- a/drivers/gpu/drm/msm/Makefile
+++ b/drivers/gpu/drm/msm/Makefile
 <at>  <at>  -7,6 +7,7  <at>  <at>  msm-y := \
 	adreno/adreno_device.o \
 	adreno/adreno_gpu.o \
 	adreno/a3xx_gpu.o \
+	adreno/a4xx_gpu.o \
 	hdmi/hdmi.o \
 	hdmi/hdmi_audio.o \
 	hdmi/hdmi_bridge.o \
diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
new file mode 100644
(Continue reading)

Ganesan, Aravind | 30 Oct 22:11 2014

[PATCH] drm/msm: Handle register offset differences between a3xx and a4xx

Register offsets have changed between a3xx and a4xx GPUs.
To be able access these registers in common code, we create
a lookup table, and set of read-write APIs to access the
register through the lookup table.

Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
 drivers/gpu/drm/msm/adreno/a3xx_gpu.c   | 103 +++++++++++++++++++++++++
 drivers/gpu/drm/msm/adreno/adreno_gpu.c |  17 +++--
 drivers/gpu/drm/msm/adreno/adreno_gpu.h | 130
++++++++++++++++++++++++++++++++
 3 files changed, 244 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
index 6c4a91a..9713aef9 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c
 <at>  <at>  -2,6 +2,8  <at>  <at> 
  * Copyright (C) 2013 Red Hat
  * Author: Rob Clark <robdclark <at> gmail.com>
  *
+ * Copyright (c) 2014 The Linux Foundation. All rights reserved.
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as
published by
  * the Free Software Foundation.
 <at>  <at>  -404,6 +406,106  <at>  <at>  static void a3xx_dump(struct msm_gpu *gpu)
 			gpu_read(gpu, REG_A3XX_RBBM_STATUS));
(Continue reading)

Ganesan, Aravind | 30 Oct 22:11 2014

[PATCH] drm/msm: Additional definitions for a3xx and a4xx

Updated a3xx and a4xx headers generated from rnndb files:
https://github.com/freedreno/envytools

Signed-off-by: Aravind Ganesan <aravindg <at> codeaurora.org>
---
 drivers/gpu/drm/msm/adreno/a3xx.xml.h |   50 +-
 drivers/gpu/drm/msm/adreno/a4xx.xml.h | 2062
+++++++++++++++++++++++++++++++++
 2 files changed, 2102 insertions(+), 10 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/adreno/a4xx.xml.h

diff --git a/drivers/gpu/drm/msm/adreno/a3xx.xml.h
b/drivers/gpu/drm/msm/adreno/a3xx.xml.h
index 303e8a9..4bcbfab 100644
--- a/drivers/gpu/drm/msm/adreno/a3xx.xml.h
+++ b/drivers/gpu/drm/msm/adreno/a3xx.xml.h
 <at>  <at>  -8,13 +8,13  <at>  <at>  http://github.com/freedreno/envytools/
 git clone https://github.com/freedreno/envytools.git

 The rules-ng-ng source files this header was generated from are:
-- /home/robclark/src/freedreno/envytools/rnndb/adreno.xml
 (    364 bytes, from 2013-11-30 14:47:15)
-- /home/robclark/src/freedreno/envytools/rnndb/freedreno_copyright.xml
 (   1453 bytes, from 2013-03-31 16:51:27)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/a2xx.xml
 (  32901 bytes, from 2014-06-02 15:21:30)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_common.xml
(   9859 bytes, from 2014-06-02 15:21:30)
-- /home/robclark/src/freedreno/envytools/rnndb/adreno/adreno_pm4.xml
 (  14477 bytes, from 2014-05-16 11:51:57)
(Continue reading)

Kiran Padwal | 30 Oct 07:25 2014

[PATCH] msm: iommu: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Kiran Padwal <kiran.padwal <at> smartplayin.com>
---
 drivers/iommu/msm_iommu_dev.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c
index 9574d21..b6d01f9 100644
--- a/drivers/iommu/msm_iommu_dev.c
+++ b/drivers/iommu/msm_iommu_dev.c
 <at>  <at>  -131,7 +131,7  <at>  <at>  static int msm_iommu_probe(struct platform_device *pdev)
 	struct clk *iommu_clk;
 	struct clk *iommu_pclk;
 	struct msm_iommu_drvdata *drvdata;
-	struct msm_iommu_dev *iommu_dev = pdev->dev.platform_data;
+	struct msm_iommu_dev *iommu_dev = dev_get_platdata(&pdev->dev);
 	void __iomem *regs_base;
 	int ret, irq, par;

 <at>  <at>  -263,7 +263,7  <at>  <at>  static int msm_iommu_remove(struct platform_device *pdev)

 static int msm_iommu_ctx_probe(struct platform_device *pdev)
 {
-	struct msm_iommu_ctx_dev *c = pdev->dev.platform_data;
+	struct msm_iommu_ctx_dev *c = dev_get_platdata(&pdev->dev);
 	struct msm_iommu_drvdata *drvdata;
 	struct msm_iommu_ctx_drvdata *ctx_drvdata;
 	int i, ret;
(Continue reading)


Gmane