[PATCH] drm/tegra: Expose color key and plane blending controls to userspace

2016-09-02 Thread Dmitry Osipenko
Chromakey is a simple way of video overlay overlap implementation. This patch adds 2 new IOCTL's: first - sets color key and is common across of all Tegra SoC's, second - sets plane blending controls and allows to utilize the color key, this one is exclusive to Tegra20/30. Signed-off-by: Dmitry

[PATCH] drm/tegra: Expose color key and plane blending controls to userspace

2016-09-04 Thread Dmitry Osipenko
On 02.09.2016 18:51, Thierry Reding wrote: > On Fri, Sep 02, 2016 at 05:32:19PM +0200, Thierry Reding wrote: >> On Fri, Sep 02, 2016 at 12:33:42PM +0300, Dmitry Osipenko wrote: >>> Chromakey is a simple way of video overlay overlap implementation. This >>> patch adds

[PATCH] drm/tegra: Fix window[0] base address corruption

2016-08-21 Thread Dmitry Osipenko
address. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 39940f5..a98dd3e 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c

[PATCH] drm/tegra: dc: Apply clipping to the overlay plane

2016-08-26 Thread Dmitry Osipenko
Overlay plane should be clipped, otherwise overlay output gets distorted once plane crosses display boundary. As a "side effect" this patch also adds a sanity check for the primary plane, insuring that it covers whole display area. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/

[PATCH 1/1] drm/tegra: Add guard to avoid double disable/enable of RGB outputs

2014-02-11 Thread Dmitry Osipenko
Add guard to check whether RGB output is already enabled in the way it's done for HDMI output. Fixes possible hang on trying to disable output twice (first time during driver probe and second on fb registering). Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/rgb.c | 11 +++ 1

[PATCH 1/1] drm/tegra: Add guard to avoid double disable/enable of RGB outputs

2014-02-11 Thread Dmitry Osipenko
11.02.2014 23:13, Erik Faye-Lund ?: > On Tue, Feb 11, 2014 at 6:12 PM, Dmitry Osipenko wrote: >> Add guard to check whether RGB output is already enabled in the way it's >> done for HDMI output. Fixes possible hang on trying to disable output twice >> (first tim

[PATCH] gpu: host1x: Fix MLOCK's debug info

2015-09-07 Thread Dmitry Osipenko
28.06.2015 22:27, Dmitry Osipenko пишет: > MLOCK's debug info, spewed on CDMA timeout, contains meaningless MLOCK > owner channel ID because HOST1X_SYNC_MLOCK_OWNER_CHID_F() returns shifted > value, while unshifted should be used. Fix it by changing '_F' to '_V'. > > Signed

[PATCH] gpu: host1x: Fix MLOCK's debug info

2015-06-28 Thread Dmitry Osipenko
MLOCK's debug info, spewed on CDMA timeout, contains meaningless MLOCK owner channel ID because HOST1X_SYNC_MLOCK_OWNER_CHID_F() returns shifted value, while unshifted should be used. Fix it by changing '_F' to '_V'. Signed-off-by: Dmitry Osipenko --- drivers/gpu/host1x/hw/debug_hw.c

[PATCH] drm/tegra: Reset the SOR during initialization

2015-03-26 Thread Dmitry Osipenko
25.03.2015 11:59, Tomeu Vizoso пишет: > As there isn't a way for the firmware on the Nyan chromebooks to hand > over the display to the kernel, and the kernel isn't redoing the whole > configuration at present. > > With this patch, the SOR is brought to a known state and we get correct >

[PATCH] drm/tegra: rgb: Use atomic DPMS helpers

2015-05-18 Thread Dmitry Osipenko
Panel DPMS got broken after adding support for atomic modesetting. Fix it by making RGB output use of generic atomic DPMS helpers. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/rgb.c | 49 - 1 file changed, 17 insertions(+), 32 deletions

Re: [PATCH] drm/tegra: Prevent BOs from being freed during job submission

2017-08-12 Thread Dmitry Osipenko
On 11.08.2017 20:59, Thierry Reding wrote: > From: Dmitry Osipenko <dig...@gmail.com> > > Since DRM IOCTL's are lockless, there is a chance that BOs could be > released while a job submission is in progress. To avoid that, keep the > GEM reference until the job has been

Re: [PATCH] drm/tegra: Prevent BOs from being freed during job submission

2017-08-13 Thread Dmitry Osipenko
On 11.08.2017 21:16, Dmitry Osipenko wrote: > On 11.08.2017 20:59, Thierry Reding wrote: >> From: Dmitry Osipenko <dig...@gmail.com> >> >> Since DRM IOCTL's are lockless, there is a chance that BOs could be >> released while a job submission is in progress. To avoi

Re: [PATCH] drm/tegra: Prevent BOs from being freed during job submission

2017-08-13 Thread Dmitry Osipenko
On 11.08.2017 20:59, Thierry Reding wrote: > From: Dmitry Osipenko <dig...@gmail.com> > > Since DRM IOCTL's are lockless, there is a chance that BOs could be > released while a job submission is in progress. To avoid that, keep the > GEM reference until the job has been

Re: [PATCH 2/2] gpu: host1x: Fix bitshift/mask multipliers

2017-08-02 Thread Dmitry Osipenko
/hw/syncpt_hw.c > b/drivers/gpu/host1x/hw/syncpt_hw.c > index c93f74fcce72..7b0270d60742 100644 > --- a/drivers/gpu/host1x/hw/syncpt_hw.c > +++ b/drivers/gpu/host1x/hw/syncpt_hw.c > @@ -89,7 +89,7 @@ static int syncpt_cpu_incr(struct host1x_syncpt *sp) > host1x_syncpt_idle(sp)) >

Re: [PATCH 1/2] gpu: host1x: Don't fail on NULL bo physical address

2017-08-02 Thread Dmitry Osipenko
if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && host->domain) { > for_each_sg(sgt->sgl, sg, sgt->nents, j) > I think 'Fixes' tag isn't really needed for this patch since it's not a bug fix, but a cleanup. Reviewed-by: Dmitry Osipenko

Re: [PATCH 1/2] gpu: host1x: Don't fail on NULL bo physical address

2017-08-02 Thread Dmitry Osipenko
On 02.08.2017 14:16, Mikko Perttunen wrote: > On 08/02/2017 02:06 PM, Dmitry Osipenko wrote: >> On 02.08.2017 12:55, Mikko Perttunen wrote: >>> Pinning a Host1x BO currently cannot fail and zero is a valid address >>> for a BO when IOMMU is enabled. To avoid false errors

Re: [PATCH 5/6] gpu: host1x: Add Tegra186 support

2017-08-17 Thread Dmitry Osipenko
regressions spotted on Tegra20. Reviewed-by: Dmitry Osipenko <dig...@gmail.com> Tested-by: Dmitry Osipenko <dig...@gmail.com> -- Dmitry ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] gpu: host1x: Do not leak BO's phys address to userspace

2017-05-14 Thread Dmitry Osipenko
Do gathers coping before patching them, so the original gathers are left untouched. That's not as bad as leaking a kernel addresses, but still doesn't feel right. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.c | 46 ++-

Re: [PATCH v2] drm/tegra: Check size of a submitted command buffer

2017-05-14 Thread Dmitry Osipenko
On 14.05.2017 15:27, Mikko Perttunen wrote: > On 05/12/2017 10:29 PM, Dmitry Osipenko wrote: >> If command buffer claims a number of words that is higher than its BO can >> fit and a relocation lays past the BO, a kernel OOPS will be fired on that >> relocation address patchin

[PATCH v2] drm/tegra: Correct idr_alloc() minimum id

2017-05-14 Thread Dmitry Osipenko
The client ID 0 is reserved by the host1x/cdma to mark the timeout timer work as already been scheduled and context ID is used as the clients one. This fixes spurious CDMA timeouts. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osi

Re: [PATCH v2] drm/tegra: Check size of a submitted command buffer

2017-05-14 Thread Dmitry Osipenko
On 12.05.2017 22:29, Dmitry Osipenko wrote: > If command buffer claims a number of words that is higher than its BO can > fit and a relocation lays past the BO, a kernel OOPS will be fired on that > relocation address patching. This was triggered by an opentegra Xorg driver > that

Re: [PATCH 2/3] drm/tegra: Correct idr_alloc() minimum id

2017-05-14 Thread Dmitry Osipenko
On 14.05.2017 14:53, Mikko Perttunen wrote: > On 05/12/2017 10:00 PM, Dmitry Osipenko wrote: >> The start = 0 is invalid and causes weird CDMA channel timeouts, presumably >> some memory misuse/corruption is going on. > > What makes you think start = 0 is invalid? I can't

[PATCH] gpu: host1x: Initialize firewall class to the jobs one

2017-05-14 Thread Dmitry Osipenko
. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 5f5f8ee6143d..d9933828fe87 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/

Re: [PATCH 2/3] drm/tegra: Correct idr_alloc() minimum id

2017-05-14 Thread Dmitry Osipenko
On 14.05.2017 16:02, Dmitry Osipenko wrote: > On 14.05.2017 14:53, Mikko Perttunen wrote: >> On 05/12/2017 10:00 PM, Dmitry Osipenko wrote: >>> The start = 0 is invalid and causes weird CDMA channel timeouts, presumably >>> some memory misuse/corruption is going on.

Re: [PATCH v2] drm/tegra: Check size of a submitted command buffer

2017-05-14 Thread Dmitry Osipenko
On 14.05.2017 15:56, Mikko Perttunen wrote: > > > On 05/14/2017 03:45 PM, Dmitry Osipenko wrote: >> On 14.05.2017 15:27, Mikko Perttunen wrote: >>> On 05/12/2017 10:29 PM, Dmitry Osipenko wrote: >>>> If command buffer claims a number of words tha

[PATCH] drm/tegra: Check offsets of a submitted command buffer and of relocations

2017-05-14 Thread Dmitry Osipenko
) [] (tegra_submit) from [] (drm_ioctl+0x1e4/0x3ec) [] (drm_ioctl) from [] (do_vfs_ioctl+0x9c/0x8e4) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x34/0x5c) [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x3c) Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com>

[PATCH] drm/tegra: Check whether page belongs to BO in tegra_bo_kmap()

2017-05-14 Thread Dmitry Osipenko
This fixes an OOPS in case of out-of-bounds accessing of a kmap'ed commands buffer CMA while patching relocations in do_relocs(). Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/gem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/tegra/g

Re: [PATCH] drm/tegra: Check offsets of a submitted command buffer and of relocations

2017-05-17 Thread Dmitry Osipenko
On 16.05.2017 11:10, Mikko Perttunen wrote: > > > On 16.05.2017 10:32, Erik Faye-Lund wrote: >> On Tue, May 16, 2017 at 8:56 AM, Mikko Perttunen <cyn...@kapsi.fi> wrote: >>> On 14.05.2017 23:47, Dmitry Osipenko wrote: >>>> >>>> If commands b

Re: [PATCH] drm/tegra: Check offsets of a submitted command buffer and of relocations

2017-05-15 Thread Dmitry Osipenko
On 14.05.2017 23:47, Dmitry Osipenko wrote: > /* copy and resolve relocations from submit */ > while (num_relocs--) { > + struct host1x_reloc *reloc; > + struct tegra_bo *obj; > + > err = host1x_reloc_copy_from_user(>

Re: [PATCH] drm/tegra: Check whether page belongs to BO in tegra_bo_kmap()

2017-05-15 Thread Dmitry Osipenko
On 14.05.2017 23:47, Dmitry Osipenko wrote: > This fixes an OOPS in case of out-of-bounds accessing of a kmap'ed commands > buffer CMA while patching relocations in do_relocs(). > > Signed-off-by: Dmitry Osipenko <dig...@gmail.com> > --- > drivers/gpu/drm/tegra/gem.c | 3

[PATCH] gpu: host1x: Forbid RESTART opcode in the firewall

2017-05-15 Thread Dmitry Osipenko
The RESTART opcode terminates the gather and restarts the CDMA fetch from a specified word << 2 relative to the CDMA start address. That shouldn't be allowed to be done by userspace. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.c | 1 - 1 file changed

Re: [PATCH] drm/tegra: Check offsets of a submitted command buffer and of relocations

2017-05-16 Thread Dmitry Osipenko
On 16.05.2017 09:56, Mikko Perttunen wrote: > On 14.05.2017 23:47, Dmitry Osipenko wrote: >> +if (reloc->cmdbuf.offset & 3 || >> +reloc->cmdbuf.offset > obj->gem.size) { > > This could still fail if the bo's size is not divisible by 4

[PATCH 2/3] drm/tegra: Correct idr_alloc() minimum id

2017-05-12 Thread Dmitry Osipenko
The start = 0 is invalid and causes weird CDMA channel timeouts, presumably some memory misuse/corruption is going on. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/drm.

[PATCH 1/3] drm/tegra: Fix lockup on a use of staging API

2017-05-12 Thread Dmitry Osipenko
Commit bdd2f9cd ("Don't leak kernel pointer to userspace") added a mutex around staging IOCTL's, some of those mutexes are taken twice. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- driver

[PATCH 3/3] drm/tegra: Check size of a submitted command buffer

2017-05-12 Thread Dmitry Osipenko
) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x34/0x5c) [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x3c) Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/drm.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drive

[PATCH v2] drm/tegra: Check size of a submitted command buffer

2017-05-12 Thread Dmitry Osipenko
) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x34/0x5c) [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x3c) Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- v2: Take into account the cmdbuf.offset drivers/gpu/drm/tegra/drm.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff

Re: [PATCH 3/3] drm/tegra: Check size of a submitted command buffer

2017-05-12 Thread Dmitry Osipenko
On 12.05.2017 22:06, Erik Faye-Lund wrote: > On Fri, May 12, 2017 at 9:02 PM, Dmitry Osipenko <dig...@gmail.com> wrote: >> + if (cmdbuf.words * 4 > gem->size) { > > Shouldn't this be "cmdbuf.offset + cmdbuf.words * 4 > gem->size"? > S

Re: [PATCH] gpu: host1x: Refactor/fix channel allocation code

2017-05-18 Thread Dmitry Osipenko
On 20.03.2017 21:44, Mikko Perttunen wrote: > This is largely a rewrite of the Host1x channel allocation > code in channel.c, bringing several changes: > > - The previous code could deadlock due to an interaction > between the 'reflock' mutex and CDMA timeout handling. > This gets rid of the

Re: [PATCH] gpu: host1x: Refactor/fix channel allocation code

2017-05-18 Thread Dmitry Osipenko
On 18.05.2017 14:55, Mikko Perttunen wrote: > On 18.05.2017 14:42, Dmitry Osipenko wrote: >> On 20.03.2017 21:44, Mikko Perttunen wrote: >>> ... >>> struct host1x_channel *host1x_channel_request(struct device *dev) >>> { >>> stru

[PATCH 20/22] gpu: host1x: Refactor channel allocation code

2017-05-22 Thread Dmitry Osipenko
upport for more than 32 channels, required for Tegra186 - General refactoring, including better encapsulation of channel ownership handling into channel.c Signed-off-by: Mikko Perttunen <mperttu...@nvidia.com> Reviewed-by: Dmitry Osipenko <dig...@gmail.com> Tested-by: Dmitry Osipenko

[PATCH 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-05-22 Thread Dmitry Osipenko
work. Let's forbid it in the firewall till a proper validation is implemented. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 190353944d23..1a1568

[PATCH 01/22] drm/tegra: Fix lockup on a use of staging API

2017-05-22 Thread Dmitry Osipenko
Commit bdd2f9cd ("Don't leak kernel pointer to userspace") added a mutex around staging IOCTL's, some of those mutexes are taken twice. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by

[PATCH 00/22] Tegra DRM fixes

2017-05-22 Thread Dmitry Osipenko
Hello, I have already sent some of the patches contained in this series and some of them got reviews. Later I added couple more patches and the dependencies started to form, so please ignore all the patches I sent before this series. The patches without r-b signatures require a review. Dmitry

[PATCH 03/22] drm/tegra: Check whether page belongs to BO in tegra_bo_kmap()

2017-05-22 Thread Dmitry Osipenko
This fixes an OOPS in case of out-of-bounds accessing of a kmap'ed cmdbuf (non-IOMMU allocation) while patching the relocations in do_relocs(). Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/gem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/g

[PATCH 06/22] drm/tegra: Check syncpoint ID in the 'submit' IOCTL

2017-05-22 Thread Dmitry Osipenko
In case of invalid syncpoint ID, the host1x_syncpt_get() returns NULL and none of its users perform a check of the returned pointer later. Let's bail out until it's too late. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/drm.c | 9 + 1 file chan

[PATCH 18/22] gpu: host1x: Remove unused 'struct host1x_cmdbuf'

2017-05-22 Thread Dmitry Osipenko
The struct host1x_cmdbuf is unused, let's remove it. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/host1x/job.h b/drivers/gpu/host1x/job.h index 0debd93a1849..4bda51d503ec 100644 --- a/d

Re: [PATCH 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-05-23 Thread Dmitry Osipenko
t is done for the registers / class checks, i.e. compare the per address register shift value. I suppose those registers are documented somewhere(TRM), could you please point me to them (TRM page, reg name)? > On 23.05.2017 03:14, Dmitry Osipenko wrote: >> Incorrectly shifted relocation address

Re: [PATCH 16/22] gpu: host1x: Forbid unrelated SETCLASS opcode in the firewall

2017-05-23 Thread Dmitry Osipenko
On 23.05.2017 03:39, Erik Faye-Lund wrote: > On Tue, May 23, 2017 at 2:14 AM, Dmitry Osipenko <dig...@gmail.com> wrote: >> Several channels could be made to write the same unit concurrently via the >> SETCLASS opcode, trusting userspace is a bad idea. It should be possib

Re: [PATCH 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-05-23 Thread Dmitry Osipenko
On 23.05.2017 14:19, Mikko Perttunen wrote: > On 23.05.2017 13:58, Dmitry Osipenko wrote: >> On 23.05.2017 13:14, Mikko Perttunen wrote: >>> Reloc shifts are implemented (see assignment of u32 reloc_addr in >>> do_relocs), >>> and they

[PATCH 19/22] gpu: host1x: Remove unused host1x_cdma_stop() definition

2017-05-22 Thread Dmitry Osipenko
There is no host1x_cdma_stop() in the code, let's remove its definition from the header file. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/cdma.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/host1x/cdma.h b/drivers/gpu/host1x/cdma.h

[PATCH 04/22] drm/tegra: Check for malformed offsets and sizes in the 'submit' IOCTL

2017-05-22 Thread Dmitry Osipenko
/0x510) [] (tegra_drm_submit) from [] (tegra_submit+0x50/0x6c) [] (tegra_submit) from [] (drm_ioctl+0x1e4/0x3ec) [] (drm_ioctl) from [] (do_vfs_ioctl+0x9c/0x8e4) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x34/0x5c) [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x3c) Signed-off-by: Dmitry Osipenko <

[PATCH 10/22] drm/tegra: Disable plane if it is invisible

2017-05-22 Thread Dmitry Osipenko
On Tegra20 if plane has width or height equal to 0, it will be infinitely wide or tall. Let's disable the plane if it is invisible on atomic state committing to fix the issue. The Rockchip DRM driver does the same. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegr

[PATCH 05/22] drm/tegra: Correct copying of waitchecks and disable them in the 'submit' IOCTL

2017-05-22 Thread Dmitry Osipenko
The waitchecks along with multiple syncpoints per submit are not ready for use yet, let's forbid them for now. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/drm.c | 60 ++--- drivers/gpu/host1x/job.h| 7 -- i

[PATCH 16/22] gpu: host1x: Forbid unrelated SETCLASS opcode in the firewall

2017-05-22 Thread Dmitry Osipenko
, but it will be much more work. Let's forbid the unit-unrelated class changes for now. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/drm.c | 1 + drivers/gpu/drm/tegra/drm.h | 1 + drivers/gpu/drm/tegra/gr2d.c | 12 drivers/gpu/host1x/job.c

[PATCH 22/22] Revert "iommu/tegra: gart: Do not register with bus"

2017-05-22 Thread Dmitry Osipenko
, like mmap'ing of a fallback memory allocation and using its GART aperture for an accelerated graphics operation. This reverts commit c7e3ca515e784a82223f447b79eb2090bdb91378. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/iommu/tegra-gart.c | 2 +- 1 file changed, 1 insertion

[PATCH 13/22] gpu: host1x: Do not leak BO's phys address to userspace

2017-05-22 Thread Dmitry Osipenko
Do gathers coping before patching them, so the original gathers are left untouched. That's not as bad as leaking a kernel addresses, but still doesn't feel right. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.c | 44 ++---

[PATCH 07/22] drm/tegra: Remove module ownership from the tegra_fb_ops

2017-05-22 Thread Dmitry Osipenko
The framebuffers console fbcon_startup() increments the tegra_drm module 'use' refcount via try_module_get(), causing an interlock of the DRM subsys and the tegra_drm modules. In result, the tegra_drm module can't be unloaded using rmmod. Signed-off-by: Dmitry Osipenko <dig...@gmail.

[PATCH 15/22] gpu: host1x: Forbid RESTART opcode in the firewall

2017-05-22 Thread Dmitry Osipenko
The RESTART opcode terminates the gather and restarts the CDMA fetching from a specified word << 2 relative to the CDMA start address. That shouldn't be allowed to be done by userspace. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusm

[PATCH 08/22] drm/tegra: dc: Drop the reset asserts to workaround a bug

2017-05-22 Thread Dmitry Osipenko
nteraction with the resets for now as a workaround. Fixes: 33a8eb8d40ee ("drm/tegra: dc: Implement runtime PM") Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/dc.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc

[PATCH 11/22] gpu: host1x: Initialize firewall class to the jobs one

2017-05-22 Thread Dmitry Osipenko
. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- drivers/gpu/host1x/job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 5f5f8ee6143d..d993382

[PATCH 02/22] drm/tegra: Correct idr_alloc() minimum id

2017-05-22 Thread Dmitry Osipenko
The client ID 0 is reserved by the host1x/cdma to mark the timeout timer work as already been scheduled and context ID is used as the clients one. This fixes spurious CDMA timeouts. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osi

[PATCH 21/22] drm/tegra: Don't use IOMMU on Tegra20

2017-05-22 Thread Dmitry Osipenko
There is no IOMMU on Tegra20, instead a GART would be picked as an IOMMU provider. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/drm.c | 5 - drivers/gpu/host1x/dev.c| 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/g

[PATCH 09/22] drm/tegra: dc: Apply clipping to the plane

2017-05-22 Thread Dmitry Osipenko
On Tegra20 an overlay plane should be clipped, otherwise its output is distorted once plane crosses display boundary. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/drm/tegra/dc.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff

[PATCH 17/22] gpu: host1x: Check waits in the firewall

2017-05-22 Thread Dmitry Osipenko
Check waits in the firewall in a way it is done for relocations. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/

[PATCH 12/22] gpu: host1x: Correct host1x_job_pin() error handling

2017-05-22 Thread Dmitry Osipenko
In case of relocations / waitchecks patching failure the jobs pins stay referenced till DRM file get closed, wasting memory. Add the missed unpinning. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> --- drivers/gpu/host1x/job.c | 16 +++- 1 file changed, 7 insertions

Re: [PATCH 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-06-01 Thread Dmitry Osipenko
On 01.06.2017 20:39, Mikko Perttunen wrote: > Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> > > On 05/23/2017 03:14 AM, Dmitry Osipenko wrote: >> Incorrectly shifted relocation address will cause a lower memory corruption >> and likely a hang on a write or

Re: [PATCH 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-06-01 Thread Dmitry Osipenko
On 01.06.2017 21:51, Mikko Perttunen wrote: > On 06/01/2017 09:44 PM, Dmitry Osipenko wrote: >> On 01.06.2017 21:37, Dmitry Osipenko wrote: >>> On 01.06.2017 20:39, Mikko Perttunen wrote: >>>> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> >>>&

Re: [PATCH 03/22] drm/tegra: Check whether page belongs to BO in tegra_bo_kmap()

2017-06-01 Thread Dmitry Osipenko
On 01.06.2017 21:01, Mikko Perttunen wrote: > On 05/23/2017 03:14 AM, Dmitry Osipenko wrote: >> This fixes an OOPS in case of out-of-bounds accessing of a kmap'ed cmdbuf >> (non-IOMMU allocation) while patching the relocations in do_relocs(). >> >> Signed-off-by: Dmitry

Re: [PATCH 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-06-01 Thread Dmitry Osipenko
On 01.06.2017 21:37, Dmitry Osipenko wrote: > On 01.06.2017 20:39, Mikko Perttunen wrote: >> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> >> >> On 05/23/2017 03:14 AM, Dmitry Osipenko wrote: >>> Incorrectly shifted relocation address will cause a lo

Re: [PATCH 21/22] drm/tegra: Don't use IOMMU on Tegra20

2017-06-01 Thread Dmitry Osipenko
On 23.05.2017 03:16, Dmitry Osipenko wrote: > There is no IOMMU on Tegra20, instead a GART would be picked as an IOMMU > provider. > > Signed-off-by: Dmitry Osipenko <dig...@gmail.com> > --- > drivers/gpu/drm/tegra/drm.c | 5 - > drivers/gpu/host1x/dev.c| 5

Re: [PATCH 16/22] gpu: host1x: Forbid unrelated SETCLASS opcode in the firewall

2017-06-01 Thread Dmitry Osipenko
On 01.06.2017 20:46, Mikko Perttunen wrote: > With the simplification below and the is_addr_reg change mentioned, > > Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> > > On 05/23/2017 03:14 AM, Dmitry Osipenko wrote: >> Several channels could be made to write the

Re: [PATCH 21/22] drm/tegra: Don't use IOMMU on Tegra20

2017-05-31 Thread Dmitry Osipenko
On 30.05.2017 12:21, Joerg Roedel wrote: > On Tue, May 23, 2017 at 03:16:32AM +0300, Dmitry Osipenko wrote: >> There is no IOMMU on Tegra20, instead a GART would be picked as an IOMMU >> provider. >> >> Signed-off-by: Dmitry Osipenko <dig...@gmail.com> >>

Re: [PATCH v2 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-06-14 Thread Dmitry Osipenko
On 14.06.2017 09:50, Mikko Perttunen wrote: > On 14.06.2017 02:15, Dmitry Osipenko wrote: >> Incorrectly shifted relocation address will cause a lower memory corruption >> and likely a hang on a write or a read of an arbitrary data in case of IOMMU >> absent. As o

[PATCH v3 09/20] gpu: host1x: Initialize firewall class to the jobs one

2017-06-14 Thread Dmitry Osipenko
. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> --- drivers/gpu/host1x/job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/job.c b/

[PATCH v3 05/20] drm/tegra: Check syncpoint ID in the 'submit' IOCTL

2017-06-14 Thread Dmitry Osipenko
In case of invalid syncpoint ID, the host1x_syncpt_get() returns NULL and none of its users perform a check of the returned pointer later. Let's bail out until it's too late. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> ---

[PATCH v3 04/20] drm/tegra: Correct copying of waitchecks and disable them in the 'submit' IOCTL

2017-06-14 Thread Dmitry Osipenko
The waitchecks along with multiple syncpoints per submit are not ready for use yet, let's forbid them for now. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- drivers/gpu/drm/tegr

[PATCH v3 14/20] gpu: host1x: Forbid unrelated SETCLASS opcode in the firewall

2017-06-14 Thread Dmitry Osipenko
, but it will be much more work. Let's forbid the unit-unrelated class changes for now. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- drivers/gpu/drm/tegra/drm.c | 1 + dri

[PATCH v3 02/20] drm/tegra: Correct idr_alloc() minimum id

2017-06-14 Thread Dmitry Osipenko
The client ID 0 is reserved by the host1x/cdma to mark the timeout timer work as already been scheduled and context ID is used as the clients one. This fixes spurious CDMA timeouts. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osi

Re: [PATCH v2 14/22] gpu: host1x: Forbid relocation address shifting in the firewall

2017-06-14 Thread Dmitry Osipenko
On 14.06.2017 14:47, Mikko Perttunen wrote: > > > On 14.06.2017 12:06, Dmitry Osipenko wrote: >> On 14.06.2017 09:50, Mikko Perttunen wrote: >>> On 14.06.2017 02:15, Dmitry Osipenko wrote: >>>> Incorrectly shifted relocation address will cause a lower memo

[PATCH v3 08/20] drm/tegra: dc: Disable plane if it is invisible

2017-06-14 Thread Dmitry Osipenko
On Tegra20 if plane has width or height equal to 0, it will be infinitely wide or tall. Let's disable the plane if it is invisible on atomic state committing to fix the issue. The Rockchip DRM driver does the same. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Fay

[PATCH v3 06/20] drm/tegra: dc: Avoid reset asserts on Tegra20

2017-06-14 Thread Dmitry Osipenko
"drm/tegra: dc: Implement runtime PM") Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> --- drivers/gpu/drm/tegra/dc.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/

[PATCH v3 20/20] gpu: host1x: At first try a non-blocking allocation for the gather copy

2017-06-14 Thread Dmitry Osipenko
) performance indistinguishable with/without the firewall. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> --- drivers/gpu/host1x/job.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/ho

[PATCH v3 01/20] drm/tegra: Fix lockup on a use of staging API

2017-06-14 Thread Dmitry Osipenko
Commit bdd2f9cd ("Don't leak kernel pointer to userspace") added a mutex around staging IOCTL's, some of those mutexes are taken twice. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by

Re: [PATCH v2 22/22] gpu: host1x: At first try a non-blocking allocation for the gather copy

2017-06-14 Thread Dmitry Osipenko
On 14.06.2017 10:56, Erik Faye-Lund wrote: > On Wed, Jun 14, 2017 at 1:16 AM, Dmitry Osipenko <dig...@gmail.com> wrote: >> The blocking gather copy allocation is a major performance downside of the >> Host1x firewall, it may take hundreds milliseconds which is unacceptable

[PATCH v3 13/20] gpu: host1x: Forbid RESTART opcode in the firewall

2017-06-14 Thread Dmitry Osipenko
The RESTART opcode terminates the gather and restarts the CDMA fetching from a specified word << 2 relative to the CDMA start address. That shouldn't be allowed to be done by userspace. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmai

Re: [PATCH v2 09/22] drm/tegra: Don't use IOMMU on Tegra20

2017-06-14 Thread Dmitry Osipenko
On 14.06.2017 13:22, Dmitry Osipenko wrote: > On 14.06.2017 10:39, Erik Faye-Lund wrote: >> On Wed, Jun 14, 2017 at 1:15 AM, Dmitry Osipenko <dig...@gmail.com> wrote: >>> There is no IOMMU on Tegra20, instead a GART would be picked as an IOMMU >>> provider. >&

[PATCH v3 00/20] Tegra DRM fixes

2017-06-14 Thread Dmitry Osipenko
nt. All the patches got a r-b, series should be good to go. Dmitry Osipenko (19): drm/tegra: Fix lockup on a use of staging API drm/tegra: Correct idr_alloc() minimum id drm/tegra: Check for malformed offsets and sizes in the 'submit' IOCTL drm/tegra: Correct copying of waitche

[PATCH v3 12/20] gpu: host1x: Forbid relocation address shifting in the firewall

2017-06-14 Thread Dmitry Osipenko
forbid shifts in the firewall till a proper validation is implemented. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- drivers/gpu/host1x/job.c | 4 1 file changed, 4 i

[PATCH v3 07/20] drm/tegra: dc: Apply clipping to the plane

2017-06-14 Thread Dmitry Osipenko
On Tegra20 an overlay plane should be clipped, otherwise its output is distorted once plane crosses display boundary. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> --- drivers/gpu/drm/tegra/dc.c | 29 +

[PATCH v3 15/20] gpu: host1x: Correct swapped arguments in the is_addr_reg() definition

2017-06-14 Thread Dmitry Osipenko
Arguments of the .is_addr_reg() are swapped in the definition of the function, that is quite confusing. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- include/linux/

[PATCH v3 03/20] drm/tegra: Check for malformed offsets and sizes in the 'submit' IOCTL

2017-06-14 Thread Dmitry Osipenko
/0x510) [] (tegra_drm_submit) from [] (tegra_submit+0x50/0x6c) [] (tegra_submit) from [] (drm_ioctl+0x1e4/0x3ec) [] (drm_ioctl) from [] (do_vfs_ioctl+0x9c/0x8e4) [] (do_vfs_ioctl) from [] (SyS_ioctl+0x34/0x5c) [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x3c) Signed-off-by: Dmitry Osipenko <

Re: [PATCH v2 09/22] drm/tegra: Don't use IOMMU on Tegra20

2017-06-14 Thread Dmitry Osipenko
On 14.06.2017 10:39, Erik Faye-Lund wrote: > On Wed, Jun 14, 2017 at 1:15 AM, Dmitry Osipenko <dig...@gmail.com> wrote: >> There is no IOMMU on Tegra20, instead a GART would be picked as an IOMMU >> provider. >> >> Signed-off-by: Dmitry Osipenko <dig...@gmail.

[PATCH v3 19/20] gpu: host1x: Refactor channel allocation code

2017-06-14 Thread Dmitry Osipenko
upport for more than 32 channels, required for Tegra186 - General refactoring, including better encapsulation of channel ownership handling into channel.c Signed-off-by: Mikko Perttunen <mperttu...@nvidia.com> Reviewed-by: Dmitry Osipenko <dig...@gmail.com> Tested-by: Dmitry Osipenko

[PATCH v3 16/20] gpu: host1x: Check waits in the firewall

2017-06-14 Thread Dmitry Osipenko
Check waits in the firewall in a way it is done for relocations. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> --- drivers/gpu/host1x/job.c | 36 ++

[PATCH v3 11/20] gpu: host1x: Do not leak BO's phys address to userspace

2017-06-14 Thread Dmitry Osipenko
Perform gathers coping before patching them, so that original gathers are left untouched. That's not as bad as leaking kernel addresses, but still doesn't feel right. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- driver

[PATCH v3 10/20] gpu: host1x: Correct host1x_job_pin() error handling

2017-06-14 Thread Dmitry Osipenko
In case of relocations / waitchecks patching failure the jobs pins stay referenced till DRM file get closed, wasting memory. Add the missed unpinning. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> Reviewed-by: Mikko Perttu

[PATCH v3 17/20] gpu: host1x: Remove unused 'struct host1x_cmdbuf'

2017-06-14 Thread Dmitry Osipenko
The struct host1x_cmdbuf is unused, let's remove it. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- drivers/gpu/host1x/job.h | 7 --- 1 file changed, 7 deleti

[PATCH v3 18/20] gpu: host1x: Remove unused host1x_cdma_stop() definition

2017-06-14 Thread Dmitry Osipenko
There is no host1x_cdma_stop() in the code, let's remove its definition from the header file. Signed-off-by: Dmitry Osipenko <dig...@gmail.com> Reviewed-by: Erik Faye-Lund <kusmab...@gmail.com> Reviewed-by: Mikko Perttunen <mperttu...@nvidia.com> --- drivers/gpu/host1x/cd

[PATCH v2 00/22] Tegra DRM fixes

2017-06-13 Thread Dmitry Osipenko
the firewall" patch has been reworked to not break newer Tegra's. Thanks to Erik, Mikko, Nicolas and Thierry for the reviews and suggestions. Dmitry Osipenko (21): drm/tegra: Fix lockup on a use of staging API drm/tegra: Correct idr_alloc() minimum id drm/tegra: Check for malformed

[PATCH v2 02/22] drm/tegra: Correct idr_alloc() minimum id

2017-06-13 Thread Dmitry Osipenko
The client ID 0 is reserved by the host1x/cdma to mark the timeout timer work as already been scheduled and context ID is used as the clients one. This fixes spurious CDMA timeouts. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osi

  1   2   3   4   5   6   7   8   >