[PATCH libdrm] tegra: Add VIC clear test

2015-05-21 Thread Arto Merilainen
This patch adds a simple test for testing Video-Image-Compositor engine on Tegra124 SoC. The test case opens a channel and performs a surface clear. Signed-off-by: Arto Merilainen --- tests/tegra/Makefile.am | 3 +- tests/tegra/host1x.h | 52 ++ tests/tegra/submit_vic.c | 315

[PATCH 0/4] Add VIC support for Tegra124

2015-05-21 Thread Arto Merilainen
] https://developer.nvidia.com/linux-tegra (*) Currently Tegra DRM does not support mapping the host1x command buffers into kernel address space in case IOMMU is enabled. Arto Merilainen (4): host1x: Store device address to all bufs host1x: Pass register value in firewall drm/tegra: Add VIC

[PATCH 1/4] host1x: Store device address to all bufs

2015-05-21 Thread Arto Merilainen
also storing the device address (physical or iova) to this buffer. This patch reworks the host1x_job_pin() to store the device address to all gathers. Signed-off-by: Andrew Chew Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/job.c | 9 ++--- 1 file changed, 6 insertions(+), 3

[PATCH 2/4] host1x: Pass register value in firewall

2015-05-21 Thread Arto Merilainen
either address or data field. This patch updates the firewall interface to deliver also the register value to allow book-keeping inside the engine driver. Signed-off-by: Arto Merilainen --- drivers/gpu/drm/tegra/drm.h | 4 ++-- drivers/gpu/drm/tegra/gr2d.c | 4 ++-- drivers/gpu/drm/tegra

[PATCH 3/4] drm/tegra: Add VIC support

2015-05-21 Thread Arto Merilainen
-by: Andrew Chew Signed-off-by: Arto Merilainen --- drivers/gpu/drm/tegra/Makefile | 3 +- drivers/gpu/drm/tegra/drm.c| 9 +- drivers/gpu/drm/tegra/drm.h| 1 + drivers/gpu/drm/tegra/vic.c| 593 + drivers/gpu/drm/tegra/vic.h| 116

[PATCH 4/4] ARM: tegra: Add VIC for Tegra124

2015-05-21 Thread Arto Merilainen
This patch adds VIC device tree node for Video Image Compositor. Signed-off-by: Arto Merilainen --- arch/arm/boot/dts/tegra124.dtsi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi index 13cc7ca5e031..626355693a41

[PATCH 3/4] drm/tegra: Add VIC support

2015-05-21 Thread Arto Merilainen
host1x.txt in a > separate patch. Will do. > On 05/21/2015 04:20 PM, Arto Merilainen wrote: >> This patch adds support for Video Image Compositor engine which >> can be used for 2d operations. >> >> The engine has a microcontroller (Falcon) that acts as a fron

[PATCH libdrm] tegra: Add VIC clear test

2015-05-21 Thread Arto Merilainen
Thank you Emil for your feedback, On 05/21/2015 05:58 PM, Emil Velikov wrote: > Hi Arto, > > On 21 May 2015 at 14:18, Arto Merilainen wrote: >> This patch adds a simple test for testing Video-Image-Compositor >> engine on Tegra124 SoC. The test case opens a channel and

[PATCH 3/4] drm/tegra: Add VIC support

2015-05-22 Thread Arto Merilainen
Hi Thierry, On 05/22/2015 01:02 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Thu, May 21, 2015 at 06:44:08PM +0300, Mikko Perttunen wrote: >> On 05/21/2015 06:10 PM, Arto Merilainen wrote: >>> ... >>>>> + >>>>> +vic-&g

[PATCH 3/4] drm/tegra: Add VIC support

2015-05-22 Thread Arto Merilainen
Hi Thierry, On 05/22/2015 01:02 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Thu, May 21, 2015 at 06:44:08PM +0300, Mikko Perttunen wrote: >> On 05/21/2015 06:10 PM, Arto Merilainen wrote: >>> ... >>>>> + >>>>> +vic-&g

[PATCH 3/4] drm/tegra: Add VIC support

2015-05-25 Thread Arto Merilainen
On 05/22/2015 01:25 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Thu, May 21, 2015 at 05:40:31PM +0300, Mikko Perttunen wrote: >> On 05/21/2015 04:20 PM, Arto Merilainen wrote: > [...] >>> +static int vic_is_addr_reg(struct device *dev, u32 clas

[PATCH 3/4] drm/tegra: Add VIC support

2015-05-25 Thread Arto Merilainen
Hi Thierry, Thank you for your thorough analysis - and sorry for a bunch of very silly mistakes. I am skipping most trivial parts and focus on the trickier comments and questions. On 05/22/2015 02:47 PM, Thierry Reding wrote: >> + >> +struct tegra_bo *ucode_bo; >> +bool ucode_valid; >>

[PATCHv3 0/4] gpu: host1x: Add runtime pm support

2013-09-24 Thread Arto Merilainen
This series adds runtime pm support for host1x, gr2d and dc. It retains the current behaviour if CONFIG_PM_RUNTIME is not enabled. The gr2d clock is enabled when a new job is submitted and disabled when the work is done. Due to parent->child relations between host1x->gr2d, this scheme enables and

[PATCHv3 2/4] drm/tegra: Add runtime pm support for gr2d

2013-09-24 Thread Arto Merilainen
remove. Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c | 57 +++ drivers/gpu/host1x/job.c | 5 ++-- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/host1x/drm/gr2d.c b

[PATCHv3 4/4] gpu: host1x: Add runtime pm support for host1x

2013-09-24 Thread Arto Merilainen
From: Mayuresh Kulkarni This patch adds runtime pm support for host1x hardware unit. This allows host1x clock to be turned off when it is idle. If pm runtime is not configured, we enable host1x clock in device probe and disable it in remove. Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto

[PATCHv3 1/4] gpu: host1x: shuffle job APIs

2013-09-24 Thread Arto Merilainen
From: Mayuresh Kulkarni This patch moves function host1x_job_submit() to job.c file where all other host1x_job_* functions are placed. This patch also introduces function host1x_job_complete(). Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/cdma.c

[PATCHv3 3/4] drm/tegra: Add runtime pm support for dc

2013-09-24 Thread Arto Merilainen
remove). Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/dc.c | 58 + 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/host1x/drm/dc.c b/drivers/gpu/host1x/drm/dc.c index b1a05ad

Re: [PATCHv3 2/4] drm/tegra: Add runtime pm support for gr2d

2013-10-01 Thread Arto Merilainen
On 10/01/2013 09:14 PM, Stephen Warren wrote: On 09/24/2013 06:05 AM, Arto Merilainen wrote: diff --git a/drivers/gpu/host1x/drm/gr2d.c b/drivers/gpu/host1x/drm/gr2d.c @@ -327,11 +336,48 @@ static int __exit gr2d_remove(struct platform_device *pdev) host1x_syncpt_free(gr2d

Re: [PATCHv3 4/4] gpu: host1x: Add runtime pm support for host1x

2013-10-01 Thread Arto Merilainen
On 10/01/2013 09:17 PM, Stephen Warren wrote: On 09/24/2013 06:05 AM, Arto Merilainen wrote: From: Mayuresh Kulkarni This patch adds runtime pm support for host1x hardware unit. This allows host1x clock to be turned off when it is idle. If pm runtime is not configured, we enable host1x clock

Re: [RFC libdrm] Add NVIDIA Tegra support

2012-12-05 Thread Arto Merilainen
On 12/04/2012 05:13 PM, Thierry Reding wrote: +int drm_tegra_open(const char *path, struct drm_tegra **devicep) +{ + struct drm_tegra *device; + int err; + + if (!path || !devicep) + return -EINVAL; + + device = calloc(1, sizeof(*device)); + if (!device

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-21 Thread Arto Merilainen
On 12/20/2012 07:14 PM, Stephen Warren wrote: What's wrong with just having each device ask the host1x (its parent) for a pointer to the (dummy) tegradrm device. That seems extremely We are talking about creating a dummy device because: - we need to give something for drm_platform_init(), - d

Re: [RFC,libdrm 1/3] tegra: Add stream library

2012-12-27 Thread Arto Merilainen
On 12/28/2012 08:47 AM, Mark Zhang wrote: +int tegra_fence_is_valid(const struct tegra_fence *fence) +{ +int valid = fence ? 1 : 0; +valid = valid && fence->id != (uint32_t) -1; +valid = valid && fence->id < 32; Hardcode here. Assume always has 32 syncpts. Change to a micro wrapped

Re: [RFC,libdrm 1/3] tegra: Add stream library

2012-12-28 Thread Arto Merilainen
On 12/28/2012 09:57 AM, Mark Zhang wrote: On 12/28/2012 03:45 PM, Arto Merilainen wrote: On 12/28/2012 08:47 AM, Mark Zhang wrote: + +/* Add fences */ +if (num_fences) { + +tegra_stream_push(stream, +nvhost_opcode_setclass(NV_HOST1X_CLASS_ID

Re: [RFC,libdrm 1/3] tegra: Add stream library

2012-12-28 Thread Arto Merilainen
On 12/28/2012 11:04 AM, Mark Zhang wrote: On 12/28/2012 04:50 PM, Arto Merilainen wrote: In my opinion asking tegra_stream_begin() to put a bad fence into the stream is a case we should never be. assert() kills the application immediately (in debug builds) and usually this helps the programmer

[RFCv2,libdrm 0/2] NVIDIA Tegra support

2013-04-12 Thread Arto Merilainen
buffer management - Removed 2d related patches from the series - Rebased to latest libdrm - Updated ioctl interface - Fixed stylish issues [0]: http://gitorious.org/linux-host1x/linux-host1x [1]: http://gitorious.org/linux-host1x/libdrm-host1x/commits/2d Arto Merilainen (2): tegra: Add stream

[RFCv2,libdrm 1/2] tegra: Add stream library

2013-04-12 Thread Arto Merilainen
This patch introduces tegra stream library. The library is used for buffer management, command stream construction and work synchronization. Signed-off-by: Arto Merilainen --- Makefile.am|6 +- configure.ac | 13 + tegra/Makefile.am | 25 ++ tegra

[RFCv2,libdrm 2/2] tests: tegra: Add stream library test

2013-04-12 Thread Arto Merilainen
buffer - Allocate and release memory - Use stream pools correctly Signed-off-by: Arto Merilainen --- configure.ac |1 + tests/tegra/host1x/Makefile.am | 12 + tests/tegra/host1x/tegra_host1x_test.c | 893 3 files changed, 906

[PATCH 0/6] Miscellaneous fixes to host1x

2013-05-17 Thread Arto Merilainen
also to the userspace. The series is based on top of 3.10rc1. I have tested the patch series on cardhu by running host1x and gr2d test cases (available at [0]). I would appreciate any help in testing/reviewing these patches. [0] https://gitorious.org/linux-host1x/libdrm-host1x Arto Merilainen (5

[PATCH 1/6] gpu: host1x: Fixes to host1x firewall

2013-05-17 Thread Arto Merilainen
s the buffer validation occur after copying the buffers. Signed-off-by: Terje Bergstrom Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/job.c | 120 -- 1 file changed, 53 insertions(+), 67 deletions(-) diff --git a/drivers/gpu/host1x/jo

[PATCH 2/6] gpu: host1x: Fix syncpoint wait return value

2013-05-17 Thread Arto Merilainen
Syncpoint wait returned EAGAIN if it was called with zero timeout. This patch modifies the function to return ETIMEDOUT. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/syncpt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/syncpt.c b

[PATCH 3/6] gpu: host1x: Fix memory access in syncpt request

2013-05-17 Thread Arto Merilainen
This patch fixes a bad memory access in syncpoint request code. If no syncpoints were available, the code accessed unreserved memory area causing unexpected behaviour. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/syncpt.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 6/6] drm/tegra: Fix syncpoint increment return code

2013-05-17 Thread Arto Merilainen
Add syncpoint increment to return a proper return code based on the return value from host1x. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/drm.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/drm/drm.c b/drivers/gpu/host1x/drm/drm.c

[PATCH 4/6] gpu: host1x: Fix client_managed type

2013-05-17 Thread Arto Merilainen
client_managed field in syncpoint structure was defined as an integer. The field holds, however, only a boolean value. This patch modifies the type to boolean. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c |2 +- drivers/gpu/host1x/syncpt.c |8 drivers/gpu

[PATCH 5/6] gpu: host1x: Rework CPU syncpoint increment

2013-05-17 Thread Arto Merilainen
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as they are in practise doing the same thing. host1x_syncpt_incr() is also modified to return error codes. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/dev.h |8 drivers/gpu/host1x/hw/cdma_hw.c

Re: [PATCH 1/6] gpu: host1x: Fixes to host1x firewall

2013-05-26 Thread Arto Merilainen
On 05/26/2013 01:02 PM, Thierry Reding wrote: * PGP Signed by an unknown key On Fri, May 17, 2013 at 02:49:43PM +0300, Arto Merilainen wrote: From: Terje Bergstrom This patch adds several fixes to host1x firewall: - Host1x firewall does not survive if it expects a reloc, but user space

Re: [PATCH 2/6] gpu: host1x: Fix syncpoint wait return value

2013-05-26 Thread Arto Merilainen
On 05/26/2013 01:12 PM, Thierry Reding wrote: * PGP Signed by an unknown key On Fri, May 17, 2013 at 02:49:44PM +0300, Arto Merilainen wrote: Syncpoint wait returned EAGAIN if it was called with zero timeout. This patch modifies the function to return ETIMEDOUT. This description is a bit

Re: [PATCH 3/6] gpu: host1x: Fix memory access in syncpt request

2013-05-26 Thread Arto Merilainen
On 05/26/2013 01:15 PM, Thierry Reding wrote: * PGP Signed by an unknown key On Fri, May 17, 2013 at 02:49:45PM +0300, Arto Merilainen wrote: This patch fixes a bad memory access in syncpoint request code. If no syncpoints were available, the code accessed unreserved memory area causing

[PATCHv2 0/7] Miscellaneous fixes to host1x

2013-05-29 Thread Arto Merilainen
nux-host1x/libdrm-host1x Arto Merilainen (5): gpu: host1x: Check reloc table before usage gpu: host1x: Copy gathers before verification gpu: host1x: Fix memory access in syncpt request gpu: host1x: Fix client_managed type gpu: host1x: Rework CPU syncpoint increment Terje Bergstrom (2): g

[PATCHv2 1/7] gpu: host1x: Check INCR opcode correctly

2013-05-29 Thread Arto Merilainen
From: Terje Bergstrom The firewall code used a wrong loop condition (pointer to a structure) while checking INCR opcode. This patch fixes the code to use correct loop condition (number of words remaining). Signed-off-by: Terje Bergstrom Signed-off-by: Arto Merilainen --- drivers/gpu/host1x

[PATCHv2 2/7] gpu: host1x: Check reloc table before usage

2013-05-29 Thread Arto Merilainen
correctly that the firewall table is available before accessing it. In addition, check_reloc() is converted to use boolean return value (true when the reloc is valid, false when invalid). Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/job.c | 26 +- 1 file changed, 13

[PATCHv2 3/7] gpu: host1x: Don't reset firewall between gathers

2013-05-29 Thread Arto Merilainen
having knowledge about that. Signed-off-by: Terje Bergstrom Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/job.c | 73 ++-- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index

[PATCHv2 4/7] gpu: host1x: Copy gathers before verification

2013-05-29 Thread Arto Merilainen
The firewall verified gather buffers before copying them. This allowed a malicious application to rewrite the buffer content by timing the rewrite carefully. This patch makes the buffer validation occur after copying the buffers. Signed-off-by: Arto Merilainen Signed-off-by: Terje Bergstrom

[PATCHv2 5/7] gpu: host1x: Fix memory access in syncpt request

2013-05-29 Thread Arto Merilainen
This patch fixes a bad memory access in syncpoint request code. If no syncpoints were available, the code accessed unreserved memory area causing unexpected behaviour. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/syncpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCHv2 6/7] gpu: host1x: Fix client_managed type

2013-05-29 Thread Arto Merilainen
client_managed field in syncpoint structure was defined as an integer. The field holds, however, only a boolean value. This patch modifies the type to boolean. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c | 2 +- drivers/gpu/host1x/syncpt.c | 8 drivers/gpu/host1x

[PATCHv2 7/7] gpu: host1x: Rework CPU syncpoint increment

2013-05-29 Thread Arto Merilainen
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as they are in practise doing the same thing. host1x_syncpt_incr() is also modified to return error codes. User space interface is modified accordingly to pass return values. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x

Re: [PATCHv2 3/7] gpu: host1x: Don't reset firewall between gathers

2013-05-29 Thread Arto Merilainen
On 05/29/2013 02:21 PM, Thierry Reding wrote: * PGP Signed by an unknown key * Arto Merilainen wrote: [...] diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c [...] @@ -553,7 +549,6 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev) if (!err

[RFC libdrm] Add NVIDIA Tegra support

2012-12-05 Thread Arto Merilainen
On 12/04/2012 05:13 PM, Thierry Reding wrote: > +int drm_tegra_open(const char *path, struct drm_tegra **devicep) > +{ > + struct drm_tegra *device; > + int err; > + > + if (!path || !devicep) > + return -EINVAL; > + > + device = calloc(1, sizeof(*device)); > +

[RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-21 Thread Arto Merilainen
On 12/20/2012 07:14 PM, Stephen Warren wrote: > > What's wrong with just having each device ask the host1x (its parent) > for a pointer to the (dummy) tegradrm device. That seems extremely > We are talking about creating a dummy device because: - we need to give something for drm_platform_init(),

[RFC,libdrm 1/3] tegra: Add stream library

2012-12-28 Thread Arto Merilainen
On 12/28/2012 08:47 AM, Mark Zhang wrote: >> +int tegra_fence_is_valid(const struct tegra_fence *fence) >> +{ >> +int valid = fence ? 1 : 0; >> +valid = valid && fence->id != (uint32_t) -1; >> +valid = valid && fence->id < 32; > > Hardcode here. Assume always has 32 syncpts. > Change to

[RFC,libdrm 1/3] tegra: Add stream library

2012-12-28 Thread Arto Merilainen
On 12/28/2012 09:57 AM, Mark Zhang wrote: > On 12/28/2012 03:45 PM, Arto Merilainen wrote: >> On 12/28/2012 08:47 AM, Mark Zhang wrote: >>>> + >>>> +/* Add fences */ >>>> +if (num_fences) { >>>> + >>>> +

[RFC,libdrm 1/3] tegra: Add stream library

2012-12-28 Thread Arto Merilainen
On 12/28/2012 11:04 AM, Mark Zhang wrote: > On 12/28/2012 04:50 PM, Arto Merilainen wrote: >> >> In my opinion asking tegra_stream_begin() to put a bad fence into the >> stream is a case we should never be. assert() kills the application >> immediately (in debug builds)

Re: [PATCH] gpu: host1x: check relocs after all gathers are consumed

2013-10-07 Thread Arto Merilainen
consumed. Signed-off-by: Erik Faye-Lund Reviewed-by: Arto Merilainen - Arto ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCHv4 0/5] gpu: host1x: Add runtime pm support

2013-10-07 Thread Arto Merilainen
12-rc2 - Removed unnecessary #ifdefs - Added descriptions to commit messages - If runtime pm is disabled, the code calls suspend/resume functions for enabling/disabling the clocks instead of repeating the functions Arto Merilainen (1): drm/tegra: Fix gr2d initialisation clean up Mayuresh Kulka

[PATCHv4 1/5] drm/tegra: Fix gr2d initialisation clean up

2013-10-07 Thread Arto Merilainen
gr2d initialisation clean up had missing steps (i.e. host1x channel was not released if we could not register gr2d as a host1x client) that could have lead to weird issues. This patch reworks the initialisation sequence to do clean up correctly. Signed-off-by: Arto Merilainen --- drivers/gpu

[PATCHv4 2/5] gpu: host1x: shuffle job APIs

2013-10-07 Thread Arto Merilainen
From: Mayuresh Kulkarni This patch moves function host1x_job_submit() to job.c file where all other host1x_job_* functions are placed. This patch also introduces function host1x_job_complete(). Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/cdma.c

[PATCHv4 3/5] drm/tegra: Add runtime pm support for gr2d

2013-10-07 Thread Arto Merilainen
remove. Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c | 52 +-- drivers/gpu/host1x/job.c | 5 +++-- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/host1x/drm/gr2d.c b

[PATCHv4 4/5] drm/tegra: Add runtime pm support for dc

2013-10-07 Thread Arto Merilainen
remove). Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/dc.c | 59 +++-- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/host1x/drm/dc.c b/drivers/gpu/host1x/drm/dc.c index b1a05ad

[PATCHv4 5/5] gpu: host1x: Add runtime pm support for host1x

2013-10-07 Thread Arto Merilainen
From: Mayuresh Kulkarni This patch adds runtime pm support for host1x hardware unit. This allows host1x clock to be turned off when it is idle. If pm runtime is not configured, we enable host1x clock in device probe and disable it in remove. Signed-off-by: Mayuresh Kulkarni Signed-off-by: Arto

[PATCH 0/3] gpu: host1x: Add syncpoint base support

2013-10-09 Thread Arto Merilainen
test_wait_base() in tests/tegra/host1x/tegra_host1x_test.c) on cardhu. I would appreciate help in reviewing the series and testing the patches on other boards. [0] https://gitorious.org/linux-host1x/libdrm-host1x Arto Merilainen (3): gpu: host1x: Add syncpoint base support drm/tegra: Deliver

[PATCH 1/3] gpu: host1x: Add syncpoint base support

2013-10-09 Thread Arto Merilainen
This patch adds support for hardware syncpoint bases. This creates a simple mechanism for waiting an operation to complete in the middle of the command buffer. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/dev.h | 2 ++ drivers/gpu/host1x/hw/channel_hw.c | 19

[PATCH 2/3] drm/tegra: Deliver syncpoint base to user space

2013-10-09 Thread Arto Merilainen
. - Old kernels left support_base and base_id fields intact (zero) and hence the new user space applications get the correct response from the kernel (=syncpoint does not have a base). Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/drm.c | 2 ++ include/uapi/drm/tegra_drm.h | 4

[PATCH 3/3] drm/tegra: Reserve base for gr2d

2013-10-09 Thread Arto Merilainen
This patch modifies the gr2d to reserve a base for syncpoint. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/drm/gr2d.c b/drivers/gpu/host1x/drm/gr2d.c index 27ffcf1..f0c3fd5 100644 --- a

Re: [PATCH 2/3] drm/tegra: Deliver syncpoint base to user space

2013-10-11 Thread Arto Merilainen
On 10/11/2013 12:43 PM, Thierry Reding wrote: * PGP Signed by an unknown key On Wed, Oct 09, 2013 at 02:54:09PM +0300, Arto Merilainen wrote: This patch makes the necessary additions to deliver syncpoint base to the user space. This patch splits the index field in the drm_tegra_get_syncpt

Re: [PATCH 1/3] gpu: host1x: Add syncpoint base support

2013-10-11 Thread Arto Merilainen
On 10/11/2013 12:39 PM, Thierry Reding wrote: * PGP Signed by an unknown key On Wed, Oct 09, 2013 at 02:54:08PM +0300, Arto Merilainen wrote: This patch adds support for hardware syncpoint bases. This creates a simple mechanism for waiting an operation to complete in the middle of the command

[PATCH] drm/tegra: Use dma_mapping API in mmap

2013-10-11 Thread Arto Merilainen
modifies the code to use dma_mapping API for mapping buffers to user space. Signed-off-by: Arto Merilainen --- I tested this patch on cardhu using Hiroshi Doyu's series "Unified SMMU driver among Tegra SoCs" and using just pure Linux 3.12rc4. I have not tested this on T20 so I would a

[PATCHv2 0/4] gpu: host1x: Add syncpoint base support

2013-10-14 Thread Arto Merilainen
instead of separate boolean arguments - Added a separate ioctl call for querying the base associated with some syncpoint [0] https://gitorious.org/linux-host1x/libdrm-host1x Arto Merilainen (4): gpu: host1x: Add 'flags' field to syncpt request gpu: host1x: Add syncpoint base support

[PATCHv2 1/4] gpu: host1x: Add 'flags' field to syncpt request

2013-10-14 Thread Arto Merilainen
can easily add more information while requesting a syncpoint. Clients are adapted to use the new interface accordingly. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c | 2 +- drivers/gpu/host1x/syncpt.c | 14 +++--- drivers/gpu/host1x/syncpt.h | 3 ++- 3 files changed,

[PATCHv2 3/4] drm/tegra: Deliver syncpoint base to user space

2013-10-14 Thread Arto Merilainen
This patch adds a separate ioctl for delivering syncpoint base number to user space. If the syncpoint does not have an associated base, the function returns -ENXIO. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/drm.c | 25 + include/uapi/drm/tegra_drm.h | 26

[PATCHv2 2/4] gpu: host1x: Add syncpoint base support

2013-10-14 Thread Arto Merilainen
This patch adds support for hardware syncpoint bases. This creates a simple mechanism to stall the command FIFO until an operation is completed. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/dev.h | 2 ++ drivers/gpu/host1x/hw/channel_hw.c | 19

[PATCHv2 4/4] drm/tegra: Reserve base for gr2d

2013-10-14 Thread Arto Merilainen
This patch modifies the gr2d to reserve a base for syncpoint. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/drm/gr2d.c b/drivers/gpu/host1x/drm/gr2d.c index 7efd97b..337e1ad 100644 --- a

[RFCv2,libdrm 0/2] NVIDIA Tegra support

2013-04-12 Thread Arto Merilainen
buffer management - Removed 2d related patches from the series - Rebased to latest libdrm - Updated ioctl interface - Fixed stylish issues [0]: http://gitorious.org/linux-host1x/linux-host1x [1]: http://gitorious.org/linux-host1x/libdrm-host1x/commits/2d Arto Merilainen (2): tegra: Add stream

[RFCv2,libdrm 1/2] tegra: Add stream library

2013-04-12 Thread Arto Merilainen
This patch introduces tegra stream library. The library is used for buffer management, command stream construction and work synchronization. Signed-off-by: Arto Merilainen --- Makefile.am|6 +- configure.ac | 13 + tegra/Makefile.am | 25 ++ tegra

[RFCv2,libdrm 2/2] tests: tegra: Add stream library test

2013-04-12 Thread Arto Merilainen
buffer - Allocate and release memory - Use stream pools correctly Signed-off-by: Arto Merilainen --- configure.ac |1 + tests/tegra/host1x/Makefile.am | 12 + tests/tegra/host1x/tegra_host1x_test.c | 893 3 files changed, 906

[PATCH 0/6] Miscellaneous fixes to host1x

2013-05-17 Thread Arto Merilainen
also to the userspace. The series is based on top of 3.10rc1. I have tested the patch series on cardhu by running host1x and gr2d test cases (available at [0]). I would appreciate any help in testing/reviewing these patches. [0] https://gitorious.org/linux-host1x/libdrm-host1x Arto Merilainen (5

[PATCH 1/6] gpu: host1x: Fixes to host1x firewall

2013-05-17 Thread Arto Merilainen
s the buffer validation occur after copying the buffers. Signed-off-by: Terje Bergstrom Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/job.c | 120 -- 1 file changed, 53 insertions(+), 67 deletions(-) diff --git a/drivers/gpu/host1x/jo

[PATCH 2/6] gpu: host1x: Fix syncpoint wait return value

2013-05-17 Thread Arto Merilainen
Syncpoint wait returned EAGAIN if it was called with zero timeout. This patch modifies the function to return ETIMEDOUT. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/syncpt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/syncpt.c b

[PATCH 3/6] gpu: host1x: Fix memory access in syncpt request

2013-05-17 Thread Arto Merilainen
This patch fixes a bad memory access in syncpoint request code. If no syncpoints were available, the code accessed unreserved memory area causing unexpected behaviour. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/syncpt.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 6/6] drm/tegra: Fix syncpoint increment return code

2013-05-17 Thread Arto Merilainen
Add syncpoint increment to return a proper return code based on the return value from host1x. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/drm.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/drm/drm.c b/drivers/gpu/host1x/drm/drm.c

[PATCH 4/6] gpu: host1x: Fix client_managed type

2013-05-17 Thread Arto Merilainen
client_managed field in syncpoint structure was defined as an integer. The field holds, however, only a boolean value. This patch modifies the type to boolean. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c |2 +- drivers/gpu/host1x/syncpt.c |8 drivers/gpu

[PATCH 5/6] gpu: host1x: Rework CPU syncpoint increment

2013-05-17 Thread Arto Merilainen
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as they are in practise doing the same thing. host1x_syncpt_incr() is also modified to return error codes. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/dev.h |8 drivers/gpu/host1x/hw/cdma_hw.c

[PATCH 1/6] gpu: host1x: Fixes to host1x firewall

2013-05-27 Thread Arto Merilainen
On 05/26/2013 01:02 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Fri, May 17, 2013 at 02:49:43PM +0300, Arto Merilainen wrote: >> From: Terje Bergstrom >> >> This patch adds several fixes to host1x firewall: >> - Host1x firewall does not s

[PATCH 2/6] gpu: host1x: Fix syncpoint wait return value

2013-05-27 Thread Arto Merilainen
On 05/26/2013 01:12 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Fri, May 17, 2013 at 02:49:44PM +0300, Arto Merilainen wrote: >> Syncpoint wait returned EAGAIN if it was called with zero timeout. >> This patch modifies the function to return ETIMEDOUT. &g

[PATCH 3/6] gpu: host1x: Fix memory access in syncpt request

2013-05-27 Thread Arto Merilainen
On 05/26/2013 01:15 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Fri, May 17, 2013 at 02:49:45PM +0300, Arto Merilainen wrote: >> This patch fixes a bad memory access in syncpoint request code. If >> no syncpoints were available, the code accessed unre

[PATCHv2 0/7] Miscellaneous fixes to host1x

2013-05-29 Thread Arto Merilainen
nux-host1x/libdrm-host1x Arto Merilainen (5): gpu: host1x: Check reloc table before usage gpu: host1x: Copy gathers before verification gpu: host1x: Fix memory access in syncpt request gpu: host1x: Fix client_managed type gpu: host1x: Rework CPU syncpoint increment Terje Bergstrom (2): g

[PATCHv2 1/7] gpu: host1x: Check INCR opcode correctly

2013-05-29 Thread Arto Merilainen
From: Terje Bergstrom The firewall code used a wrong loop condition (pointer to a structure) while checking INCR opcode. This patch fixes the code to use correct loop condition (number of words remaining). Signed-off-by: Terje Bergstrom Signed-off-by: Arto Merilainen --- drivers/gpu/host1x

[PATCHv2 2/7] gpu: host1x: Check reloc table before usage

2013-05-29 Thread Arto Merilainen
correctly that the firewall table is available before accessing it. In addition, check_reloc() is converted to use boolean return value (true when the reloc is valid, false when invalid). Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/job.c | 26 +- 1 file changed, 13

[PATCHv2 3/7] gpu: host1x: Don't reset firewall between gathers

2013-05-29 Thread Arto Merilainen
having knowledge about that. Signed-off-by: Terje Bergstrom Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/job.c | 73 ++-- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index

[PATCHv2 4/7] gpu: host1x: Copy gathers before verification

2013-05-29 Thread Arto Merilainen
The firewall verified gather buffers before copying them. This allowed a malicious application to rewrite the buffer content by timing the rewrite carefully. This patch makes the buffer validation occur after copying the buffers. Signed-off-by: Arto Merilainen Signed-off-by: Terje Bergstrom

[PATCHv2 5/7] gpu: host1x: Fix memory access in syncpt request

2013-05-29 Thread Arto Merilainen
This patch fixes a bad memory access in syncpoint request code. If no syncpoints were available, the code accessed unreserved memory area causing unexpected behaviour. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/syncpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCHv2 6/7] gpu: host1x: Fix client_managed type

2013-05-29 Thread Arto Merilainen
client_managed field in syncpoint structure was defined as an integer. The field holds, however, only a boolean value. This patch modifies the type to boolean. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x/drm/gr2d.c | 2 +- drivers/gpu/host1x/syncpt.c | 8 drivers/gpu/host1x

[PATCHv2 7/7] gpu: host1x: Rework CPU syncpoint increment

2013-05-29 Thread Arto Merilainen
This patch merges host1x_syncpt_cpu_incr to host1x_syncpt_incr() as they are in practise doing the same thing. host1x_syncpt_incr() is also modified to return error codes. User space interface is modified accordingly to pass return values. Signed-off-by: Arto Merilainen --- drivers/gpu/host1x

[PATCHv2 3/7] gpu: host1x: Don't reset firewall between gathers

2013-05-29 Thread Arto Merilainen
On 05/29/2013 02:21 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > * Arto Merilainen wrote: > [...] >> diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c > [...] >> @@ -553,7 +549,6 @@ int host1x_job_pin(struct host1x_job *

[PATCH] drm/tegra: Support kernel mappings with IOMMU

2015-06-04 Thread Arto Merilainen
functions to host1x bo objects. Signed-off-by: Arto Merilainen --- drivers/gpu/drm/tegra/gem.c | 34 +++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 1217272a51f2..89ca8d35f555 100644 --- a