[PATCH] drm/qxl: Call qxl_bo_unref outside atomic context

2018-06-01 Thread Jeremy Cline
("drm/qxl: reapply cursor after resetting primary") Cc: sta...@vger.kernel.org Signed-off-by: Jeremy Cline --- drivers/gpu/drm/qxl/qxl_display.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_displ

Regression: no display with Vega 56 AMD GPU bisected to commit bfdec2340478

2018-07-02 Thread Jeremy Cline
Hi folks, A Fedora user, Mikhail (CCed), reported[0] a regression with their Vega 56 AMD GPU introduced by bfdec2340478 ("drm/amd/display: Implement dm_pp_get_clock_levels_by_type_with_latency"). The symptom is that nothing is displayed and looking at the logs (attached to the Bugzilla), I see

Re: [Nouveau] [PATCH] drm/nouveau: Add fine-grain temperature reporting

2020-09-09 Thread Jeremy Cline
On Wed, Sep 09, 2020 at 10:22:14AM +0200, Karol Herbst wrote: > On Wed, Sep 9, 2020 at 6:06 AM Ben Skeggs wrote: > > > > On Thu, 13 Aug 2020 at 06:50, Jeremy Cline wrote: > > > > > > Commit d32656373857 ("drm/nouveau/therm/gp100: initial implementation

Re: [PATCH v2 1/2] drm/nouveau: return temperatures in temp_get() via parameter

2020-09-17 Thread Jeremy Cline
On Wed, Sep 16, 2020 at 10:03:22PM +0200, Karol Herbst wrote: > On Wed, Sep 16, 2020 at 10:01 PM Karol Herbst wrote: > > > > On Wed, Sep 16, 2020 at 9:47 PM Jeremy Cline wrote: > > > > > > The temp_get() function currently returns negative error number

[PATCH v2 1/2] drm/nouveau: return temperatures in temp_get() via parameter

2020-09-16 Thread Jeremy Cline
, but some, like gp100_temp_get(), do not. Rather than relying on implementations remembering to clamp values, dedicate the function return value to error codes and accept a pointer to an integer where the temperature reading should be stored. Signed-off-by: Jeremy Cline --- .../drm/nouveau/include/nvkm

[PATCH v2 2/2] drm/nouveau: Add fine-grain temperature reporting

2020-09-16 Thread Jeremy Cline
clear what the unit is. Signed-off-by: Jeremy Cline --- .../nouveau/include/nvkm/subdev/bios/therm.h | 13 ++ .../drm/nouveau/include/nvkm/subdev/therm.h | 26 +++ drivers/gpu/drm/nouveau/nouveau_hwmon.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/therm/ba

[PATCH v2 0/2] Add fine-grain temperature reporting

2020-09-16 Thread Jeremy Cline
a separate helper, but was torn about whether this is clearer than a separate helper function. * I added a WARN_ON in places that previously called nvkm_therm_temp_get() and didn't check the return value for an error. This may not be a reasonable error handling method. Jeremy Cline (2): drm

[PATCH] drm/nouveau: Add fine-grain temperature reporting

2020-08-12 Thread Jeremy Cline
m_temp_get() to report finer-grain temperatures, which would be inconvenient for other users of the function, a second interface has been added to line up with hwmon's native unit of temperature. Signed-off-by: Jeremy Cline --- .../drm/nouveau/include/nvkm/subdev/therm.h | 18 + drive

Re: [PATCH] amdgpu: Avoid sleeping during FPU critical sections

2021-01-11 Thread Jeremy Cline
Hi, On Mon, Jan 11, 2021 at 09:53:56AM +0100, Christian König wrote: > Am 08.01.21 um 22:58 schrieb Jeremy Cline: > > dcn20_resource_construct() includes a number of kzalloc(GFP_KERNEL) > > calls which can sleep, but kernel_fpu_begin() disables preemption and > > sle

[PATCH] drm/ttm: Fix address passed to dma_mapping_error() in ttm_pool_map()

2021-01-11 Thread Jeremy Cline
check_unmap() is producing a warning about a missing map error check. The return value from dma_map_page() should be checked for an error, not the caller-provided dma_addr. Fixes: d099fc8f540a ("drm/ttm: new TT backend allocation pool v3") Signed-off-by: Jeremy Cline --- drivers/g

[PATCH v2] drm/amdkfd: Fix out-of-bounds read in kdf_create_vcrat_image_cpu()

2021-01-11 Thread Jeremy Cline
mically (v2)") Suggested-by: Felix Kuehling Signed-off-by: Jeremy Cline --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index 8cac497c2c45..a56

Re: [PATCH] drm/ttm: Fix address passed to dma_mapping_error() in ttm_pool_map()

2021-01-11 Thread Jeremy Cline
On Mon, Jan 11, 2021 at 09:21:48PM +0100, Christian König wrote: > Am 11.01.21 um 17:40 schrieb Jeremy Cline: > > check_unmap() is producing a warning about a missing map error check. > > The return value from dma_map_page() should be checked for an error, not > > the cal

[PATCH v2 2/3] drm/nouveau: Add a dedicated mutex for the clients list

2020-11-25 Thread Jeremy Cline
n the list and potentially lock their mutex, which is the same class as the lock protecting the entire list. Cc: sta...@vger.kernel.org Signed-off-by: Jeremy Cline --- Changes since v1: - Add a mutex_destroy() call when destroying the device struct drivers/gpu/drm/nouveau/nouveau_drm.c | 10 ++ d

[PATCH v2 3/3] drm/nouveau: clean up all clients on device removal

2020-11-25 Thread Jeremy Cline
, I've broken this out so the fix can be easily backported. Cc: sta...@vger.kernel.org Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drm.c | 30 +++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/n

[PATCH v2 0/3] drm/nouveau: fix a use-after-free in postclose()

2020-11-25 Thread Jeremy Cline
() handler. While this does not enable hot-unplug support for nouveau, it's enough to avoid crashing the kernel and leads to all the core_hotunplug tests to pass. This series reroll addresses a missing mutex_destroy() call and a typo in a commit message. Jeremy Cline (3): drm/nouveau: use

[PATCH v2 1/3] drm/nouveau: use drm_dev_unplug() during device removal

2020-11-25 Thread Jeremy Cline
support hot-unplugging. Cc: sta...@vger.kernel.org Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index d141a5f004af..4fe4d664c5f2

Re: [PATCH 2/3] drm/nouveau: Add a dedicated mutex for the clients list

2020-11-25 Thread Jeremy Cline
On Wed, Nov 25, 2020 at 01:37:06PM -0500, Lyude Paul wrote: > On Tue, 2020-11-03 at 14:49 -0500, Jeremy Cline wrote: > > Rather than protecting the nouveau_drm clients list with the lock within > > the "client" nouveau_cli, add a dedicated lock to serialize access to &

Re: [PATCH v2 13/20] drm/nouveau: Remove references to struct drm_device.pdev

2020-12-09 Thread Jeremy Cline
Hi, On Tue, Dec 01, 2020 at 11:35:35AM +0100, Thomas Zimmermann wrote: > Using struct drm_device.pdev is deprecated. Convert nouveau to struct > drm_device.dev. No functional changes. > > Signed-off-by: Thomas Zimmermann > Cc: Ben Skeggs > --- > drivers/gpu/drm/nouveau/dispnv04/arb.c |

Re: [PATCH v2 13/20] drm/nouveau: Remove references to struct drm_device.pdev

2020-12-10 Thread Jeremy Cline
On Thu, Dec 10, 2020 at 08:56:08AM +0100, Thomas Zimmermann wrote: > Hi > > Am 09.12.20 um 19:04 schrieb Jeremy Cline: > > Hi, > > > > On Tue, Dec 01, 2020 at 11:35:35AM +0100, Thomas Zimmermann wrote: > > > Using struct drm_device.pdev is d

[PATCH] drm/nouveau: avoid a use-after-free when BO init fails

2020-12-02 Thread Jeremy Cline
and the memory freed by nouveau_bo_del_ttm(). Fixes: 019cbd4a4feb ("drm/nouveau: Initialize GEM object before TTM object") Cc: Thierry Reding Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/d

Re: [Nouveau] [PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres

2020-11-10 Thread Jeremy Cline
On Fri, Nov 06, 2020 at 02:31:44PM +0100, Karol Herbst wrote: > On Fri, Nov 6, 2020 at 3:17 AM Jeremy Cline wrote: > > > > Make use of the devm_drm_dev_alloc() API to bind the lifetime of > > nouveau_drm structure to the drm_device. This is important because a > &g

[PATCH 1/3] drm/nouveau: use drm_dev_unplug() during device removal

2020-11-03 Thread Jeremy Cline
support hot-unplugging. Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index d141a5f004af..4fe4d664c5f2 100644 --- a/drivers/gpu/drm

[PATCH 3/3] drm/nouveau: clean up all clients on device removal

2020-11-03 Thread Jeremy Cline
. Thus, I've broken this out so the fix can be easily backported. Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drm.c | 30 +++ 1 file changed, 30 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c

[PATCH 2/3] drm/nouveau: Add a dedicated mutex for the clients list

2020-11-03 Thread Jeremy Cline
n the list and potentially lock their mutex, which is the same class as the lock protecting the entire list. Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drm.c | 9 + drivers/gpu/drm/nouveau/nouveau_drv.h | 5 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/d

[PATCH 0/3] drm/nouveau: fix a use-after-free in postclose()

2020-11-03 Thread Jeremy Cline
() handler. While this does not enable hot-unplug support for nouveau, it's enough to avoid crashing the kernel and leads to all the core_hotunplug tests to pass. Jeremy Cline (3): drm/nouveau: use drm_dev_unplug() during device removal drm/nouveau: Add a dedicated mutex for the clients list drm

[PATCH 1/3] drm/nouveau: Use helper to convert nouveau_drm to drm_device

2020-11-05 Thread Jeremy Cline
. This patch should introduce no functional changes. Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 10 +++--- drivers/gpu/drm/nouveau/dispnv50/base.c | 2 +- drivers/gpu/drm/nouveau/dispnv50/base507c.c | 7 ++-- drivers/gpu/drm/nouveau/dispnv50/core.c | 2

[PATCH 3/3] drm/nouveau: begin documenting core nouveau structures

2020-11-05 Thread Jeremy Cline
Start on documentation for the Nouveau device structure and the NVIF client structure it uses. This documentation is not complete as the structures are non-trivial and I am not familiar with large portions of them. Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drv.h | 67

[PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres

2020-11-05 Thread Jeremy Cline
currently occurs. Signed-off-by: Jeremy Cline --- drivers/gpu/drm/nouveau/nouveau_drm.c | 44 --- drivers/gpu/drm/nouveau/nouveau_drv.h | 10 -- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm

[PATCH 0/3] drm/nouveau: extend the lifetime of nouveau_drm

2020-11-05 Thread Jeremy Cline
before the drm_device is destroyed, so I suspect much of the current cleanup code in Nouveau would benefit from some refactoring to use this. Finally, although not *strictly* necessary for this series, I included some documentation for structures I investigated for this work. Jeremy Cline (3): drm

Re: [Nouveau] [PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres

2020-11-06 Thread Jeremy Cline
On Fri, Nov 06, 2020 at 02:31:44PM +0100, Karol Herbst wrote: > On Fri, Nov 6, 2020 at 3:17 AM Jeremy Cline wrote: > > > > Make use of the devm_drm_dev_alloc() API to bind the lifetime of > > nouveau_drm structure to the drm_device. This is important because a > &g

[PATCH] drm/amdkfd: Fix out-of-bounds read in kdf_create_vcrat_image_cpu()

2021-01-08 Thread Jeremy Cline
s read and hopefully makes the pointer arithmetic clearer. It should have no functional change beyond removing the out-of-bounds read. Fixes: b7b6c38529c9 ("drm/amdkfd: Calculate CPU VCRAT size dynamically (v2)") Signed-off-by: Jeremy Cline --- drivers/gpu/drm/amd/amdkfd

[PATCH] amdgpu: Avoid sleeping during FPU critical sections

2021-01-08 Thread Jeremy Cline
,max}_fill_clk_mhz. Narrow the scope to just these two parts to avoid sleeping while using the FPU. Fixes: 7a8a3430be15 ("amdgpu: Wrap FPU dependent functions in dc20") Cc: Timothy Pearson Signed-off-by: Jeremy Cline --- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 8 --

Re: [PATCH] drm/amdkfd: Fix out-of-bounds read in kdf_create_vcrat_image_cpu()

2021-01-08 Thread Jeremy Cline
On Fri, Jan 08, 2021 at 06:46:17PM -0500, Felix Kuehling wrote: > Am 2021-01-08 um 11:31 a.m. schrieb Jeremy Cline: > > KASAN reported a slab-out-of-bounds read of size 1 in > > kdf_create_vcrat_image_cpu(). > > > > This occurs when, for example, when on an x86

Re: [RFC PATCH v3 1/6] drm/doc: Color Management and HDR10 RFC

2021-09-16 Thread Jeremy Cline
mments below. Excellent to > have > pictures included. I wrote this reply over several days, sorry if > it's > not quite coherent. > > > > > > + > > + > > +Overview and background > > +=== > > + > > +I highly recommend you read `J