[PATCH] drm/i915/gt: Remove unneeded semicolon

2022-07-20 Thread Jason Wang
The semicolon after a code block end symbol `}' is unneeded, remove it. Signed-off-by: Jason Wang --- drivers/gpu/drm/i915/gt/intel_migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c ind

Re: [Freedreno] [PATCH v2 5/7] arm64: dts: qcom: sc7280: Update gpu register list

2022-07-20 Thread Rajendra Nayak
On 7/19/2022 12:49 PM, Stephen Boyd wrote: Quoting Akhil P Oommen (2022-07-18 23:37:16) On 7/19/2022 11:19 AM, Stephen Boyd wrote: Quoting Akhil P Oommen (2022-07-18 21:07:05) On 7/14/2022 11:10 AM, Akhil P Oommen wrote: IIUC, qcom gdsc driver doesn't ensure hardware is collapsed since the

Re: [PATCH] drm/bridge: megachips: Fix a null pointer dereference bug

2022-07-20 Thread Martyn Welch
On Sat, 2022-07-16 at 16:13 +0800, Zheyu Ma wrote: > When removing the module we will get the following warning: > > [   31.911505] i2c-core: driver [stdp2690-ge-b850v3-fw] unregistered > [   31.912484] general protection fault, probably for non-canonical > address 0xdc01: [#1] PR

[PATCH] drm/amdgpu: Fix comment typo

2022-07-20 Thread Jason Wang
The double `to' is duplicated in the comment, remove one. Signed-off-by: Jason Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index e3d13970816

[PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched()

2022-07-20 Thread Andrey Strachuk
Local variable 'rq' is initialized by an address of field of drm_sched_job, so it does not make sense to compare 'rq' with NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Strachuk Fixes: 7c6e68c777f1 ("drm/amdgpu: Avoid HW GPU reset for RAS.") --- d

[PATCH] drm/radeon: Fix comment typo

2022-07-20 Thread Jason Wang
The double `have' is duplicated in line 696, remove one. Signed-off-by: Jason Wang --- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 84843b3b3aef..261fcbae88

[PATCH] drm/i915/selftests: Fix comment typo

2022-07-20 Thread Jason Wang
Fix the double `wait' typo in comment. Signed-off-by: Jason Wang --- drivers/gpu/drm/i915/selftests/i915_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c index c56a0c2cd2f7

Re: [Intel-gfx] [PATCH v2 06/21] drm/i915/gt: Batch TLB invalidations

2022-07-20 Thread Mauro Carvalho Chehab
On Mon, 18 Jul 2022 14:52:05 +0100 Tvrtko Ursulin wrote: > > On 14/07/2022 13:06, Mauro Carvalho Chehab wrote: > > From: Chris Wilson > > > > Invalidate TLB in patch, in order to reduce performance regressions. > > "in batches"? Yeah. Will fix it. > > diff --git a/drivers/gpu/drm/i915/gt/in

Re: [PATCH 3/3] drm/panel-edp: Fix variable typo when saving hpd absent delay from DT

2022-07-20 Thread AngeloGioacchino Del Regno
Il 19/07/22 22:38, Nícolas F. R. A. Prado ha scritto: The value read from the "hpd-absent-delay-ms" property in DT was being saved to the wrong variable, overriding the hpd_reliable delay. Fix the typo. Fixes: 5540cf8f3e8d ("drm/panel-edp: Implement generic "edp-panel"s probed by EDID") Signed-

[PATCH 1/4] drm/ttm: add new intersect callback to res mgr

2022-07-20 Thread Arunpravin Paneer Selvam
- This allows the resource manager to handle intersection of placement and resources. - Add callback function to amdgpu driver module fetching start offset from buddy allocator. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt

[PATCH 3/4] drm/nouveau: Add intersect callback function

2022-07-20 Thread Arunpravin Paneer Selvam
Add a new intersect callback function fetching the start offset from struct ttm_resource. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/nouveau/nouveau_mem.c | 15 +++ drivers/gpu/drm/nouveau/nouveau_mem.h | 3 +++ drivers/gpu/drm/nouvea

[PATCH 2/4] drm/i915: Add intersect callback function

2022-07-20 Thread Arunpravin Paneer Selvam
Add a new intersect callback function fetching start offset from backend drm buddy allocator. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers

[PATCH 4/4] drm/ttm: Switch to using the new intersect callback

2022-07-20 Thread Arunpravin Paneer Selvam
Use new intersect callback instead of having a generic placement range verification. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 45 +++-- drivers/gpu/drm/ttm/ttm_bo.c| 9 +++-- drivers/gpu

Re: [PATCH v3 1/2] vfio: Replace the DMA unmapping notifier with a callback

2022-07-20 Thread Cornelia Huck
On Tue, Jul 19 2022, Jason Gunthorpe wrote: > On Thu, Jul 07, 2022 at 03:37:16PM -0600, Alex Williamson wrote: >> On Mon, 4 Jul 2022 21:59:03 -0300 >> Jason Gunthorpe wrote: >> > diff --git a/drivers/s390/cio/vfio_ccw_ops.c >> > b/drivers/s390/cio/vfio_ccw_ops.c >> > index b49e2e9db2dc6f..09e0

Re: [PATCH 1/3] drm/panel-edp: Add panel entry for R140NWF5 RH

2022-07-20 Thread AngeloGioacchino Del Regno
Il 20/07/22 00:40, Doug Anderson ha scritto: Hi, On Tue, Jul 19, 2022 at 1:39 PM Nícolas F. R. A. Prado wrote: Add panel identification entry for the IVO R140NWF5 RH (product ID: 0x057d) panel. Signed-off-by: Nícolas F. R. A. Prado --- The comments on the driver indicate that the T3 timing

Re: [PATCH v2] drm/imx/dcss: Add missing of_node_put() in fail path

2022-07-20 Thread Laurentiu Palcu
Hi, On Thu, Jul 14, 2022 at 04:13:37PM +0800, Liang He wrote: > In dcss_dev_create() and dcss_dev_destroy(), we should call of_node_put() > in fail path or before the dcss's destroy as of_graph_get_port_by_id() has > increased the refcount. > > Fixes: 9021c317b770 ("drm/imx: Add initial support

[syzbot] KASAN: invalid-free in free_prealloced_shrinker

2022-07-20 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:cb71b93c2dc3 Add linux-next specific files for 20220628 git tree: linux-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=1362115208 kernel config: https://syzkaller.appspot.com/x/.config?x=badbc1adb2d582eb dashbo

Re: [PATCH v2 08/14] drm/mgag200: Set SCROFF in primary-plane code

2022-07-20 Thread Jocelyn Falempe
On 18/07/2022 11:27, Thomas Zimmermann wrote: The SCROFF bit controls reading the primary plane's scanout buffer from video memory. Set it from primary-plane code, instead of CRTC code. I'm a bit concerned about the performance impact of this patch. Previously, the SCROFF bit and msleep(20) wa

Re: [Intel-gfx] [PATCH 1/1] drm/i915/guc: Update to GuC version 70.1.1

2022-07-20 Thread Jordan Justen
On 2022-07-14 16:08:51, Dave Airlie wrote: > On Fri, 15 Apr 2022 at 10:15, Matt Roper wrote: > > > > On Tue, Apr 12, 2022 at 03:59:55PM -0700, john.c.harri...@intel.com wrote: > > > From: John Harrison > > > > > > The latest GuC firmware drops the context descriptor pool in favour of > > > passin

Re: [PATCH v1 4/6] dma-buf: Acquire wait-wound context on attachment

2022-07-20 Thread Christian König
Am 19.07.22 um 22:05 schrieb Dmitry Osipenko: On 7/15/22 09:59, Dmitry Osipenko wrote: On 7/15/22 09:50, Christian König wrote: Am 15.07.22 um 02:52 schrieb Dmitry Osipenko: Intel i915 GPU driver uses wait-wound mutex to lock multiple GEMs on the attachment to the i915 dma-buf. In order to let

[PATCH 1/7] drm/vmwgfx: Remove trailing whitespace

2022-07-20 Thread Thomas Zimmermann
Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmw

[PATCH 7/7] drm/fsl-dcu: Use drm_plane_helper_destroy()

2022-07-20 Thread Thomas Zimmermann
Replace the driver's own function with drm_plane_helper_destroy(). No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/d

[PATCH 6/7] drm/armada: Use drm_plane_helper_destroy()

2022-07-20 Thread Thomas Zimmermann
Replace the driver's own function with drm_plane_helper_destroy(). No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/armada/armada_overlay.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/g

[PATCH 0/7] drm: Clean up plane helpers

2022-07-20 Thread Thomas Zimmermann
The plane helpers are included by dozens of files without any need. Only a hand full of source files need anything from drm_plane_helper.h. Untangle everything and tidy up the code a bit. The patches were built on x64-64, aarch64 and arm without issues. Thomas Zimmermann (7): drm/vmwgfx: Remove

[PATCH 2/7] drm/atomic-helper: Move DRM_PLANE_HELPER_NO_SCALING to atomic helpers

2022-07-20 Thread Thomas Zimmermann
The macro DRM_PLANE_HELPER_NO_SCALING is only useful with the interfaces in drm_atomic_helper.h, but defined in drm_plane_helper.h. So half of DRM includes the latter header file for using this macro. Move the macro and remove the include statements. Signed-off-by: Thomas Zimmermann --- drivers/

[PATCH 3/7] drm/atomic-helper: Remove _HELPER_ infix from DRM_PLANE_HELPER_NO_SCALING

2022-07-20 Thread Thomas Zimmermann
Rename DRM_PLANE_HELPER_NO_SCALING to DRM_PLANE_NO_SCALING. The constant is not really a helper, but rather a characteristic of the plane itself. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 +-- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +-- d

[PATCH 5/7] drm/plane-helper: Export individual helpers

2022-07-20 Thread Thomas Zimmermann
Export the individual plane helpers that make up the plane functions and align the naming with other helpers. The plane helpers are for non-atomic modesetting and exporting them will simplify a later conversion of drivers to atomic modesetting. With struct drm_plane_funcs removed from drm_plane_he

[PATCH 4/7] drm: Remove unnecessary include statements of drm_plane_helper.h

2022-07-20 Thread Thomas Zimmermann
Remove the include statement for drm_plane_helper.h from all the files that don't need it. Althogh the header file is almost empty, many drivers include it somewhere. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 - drivers/gpu/drm/arm/display/komeda/

Re: [PATCH v2 08/14] drm/mgag200: Set SCROFF in primary-plane code

2022-07-20 Thread Thomas Zimmermann
Hi Am 20.07.22 um 10:17 schrieb Jocelyn Falempe: On 18/07/2022 11:27, Thomas Zimmermann wrote: The SCROFF bit controls reading the primary plane's scanout buffer from video memory. Set it from primary-plane code, instead of CRTC code. I'm a bit concerned about the performance impact of this p

Re: [PATCH 1/4] drm/ttm: add new intersect callback to res mgr

2022-07-20 Thread Christian König
Am 20.07.22 um 09:36 schrieb Arunpravin Paneer Selvam: - This allows the resource manager to handle intersection of placement and resources. - Add callback function to amdgpu driver module fetching start offset from buddy allocator. Probably better to only add the callback and ttm_resour

Re: [PATCH 4/4] drm/ttm: Switch to using the new intersect callback

2022-07-20 Thread Christian König
Am 20.07.22 um 09:36 schrieb Arunpravin Paneer Selvam: Use new intersect callback instead of having a generic placement range verification. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 45 +++-- d

Re: [PATCH v5 11/13] leds: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-20 Thread ChiYuan Huang
On Fri, Jul 15, 2022 at 08:29:42PM +0200, Andy Shevchenko wrote: > On Fri, Jul 15, 2022 at 1:29 PM ChiaEn Wu wrote: > > > > From: ChiYuan Huang > > > > The MediaTek MT6370 is a highly-integrated smart power management IC, > > which includes a single cell Li-Ion/Li-Polymer switching battery > > ch

Re: [PATCH v5 11/13] leds: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-20 Thread ChiYuan Huang
ChiYuan Huang 於 2022年7月20日 週三 下午5:45寫道: > > On Fri, Jul 15, 2022 at 08:29:42PM +0200, Andy Shevchenko wrote: > > On Fri, Jul 15, 2022 at 1:29 PM ChiaEn Wu wrote: > > > > > > From: ChiYuan Huang > > > > > > The MediaTek MT6370 is a highly-integrated smart power management IC, > > > which includes

[PATCH 1/2] drm/i915/gem: Avoid taking runtime-pm under the shrinker

2022-07-20 Thread Janusz Krzysztofik
From: Chris Wilson Inside the shrinker, we cannot wake the device as that may cause recursion into fs-reclaim, so instead we only unbind vma if the device is currently awake. (In order to provide reclaim while asleep, we do wake the device up during kswapd -- we probably want to limit that wake u

[RFC PATCH 2/2] drm/i915/gem: Perform active shrinking from a background thread

2022-07-20 Thread Janusz Krzysztofik
From: Chris Wilson i915 is very greedy and will retain system pages for as long as the user requires them; once acquired they will be only returned when the object is freed. In order to respond to system memory pressure, i915 hooks into the shrinker subsystem, designed to prune the filesystem cac

Re: [Intel-gfx] [PATCH v2 06/21] drm/i915/gt: Batch TLB invalidations

2022-07-20 Thread Tvrtko Ursulin
On 20/07/2022 08:13, Mauro Carvalho Chehab wrote: On Mon, 18 Jul 2022 14:52:05 +0100 Tvrtko Ursulin wrote: On 14/07/2022 13:06, Mauro Carvalho Chehab wrote: From: Chris Wilson Invalidate TLB in patch, in order to reduce performance regressions. "in batches"? Yeah. Will fix it. diff

Re: [PATCH v2 06/21] drm/i915/gt: Batch TLB invalidations

2022-07-20 Thread Tvrtko Ursulin
On 14/07/2022 13:06, Mauro Carvalho Chehab wrote: From: Chris Wilson Invalidate TLB in patch, in order to reduce performance regressions. Currently, every caller performs a full barrier around a TLB invalidation, ignoring all other invalidations that may have already removed their PTEs from

Re: [PATCH v3 1/2] vfio: Replace the DMA unmapping notifier with a callback

2022-07-20 Thread Jason Gunthorpe
On Wed, Jul 20, 2022 at 09:47:12AM +0200, Cornelia Huck wrote: > > If the FSM trapped in a bad state here, such as > > VFIO_CCW_STATE_NOT_OPER, then it means it should have already unpinned > > the pages and this is considered a success for this purpose > > A rather pathological case would be a s

[PATCH v4 0/3] drm/i915/display: stop HPD workers before display driver unregister

2022-07-20 Thread Andrzej Hajda
Hi Jani, Ville, Arun, This patchset is replacement of patch "drm/i915/display: disable HPD workers before display driver unregister" [1]. Ive decided to split patch into two parts - fbdev and MST, there are different issues. Ive also dropped shutdown path, as it has slightly different requirements

[PATCH v4 1/3] drm/i915/hpd: postpone HPD cancel work after last user suspension

2022-07-20 Thread Andrzej Hajda
i915->hotplug.dig_port_work can be queued from intel_hpd_irq_handler called by IRQ handler or by intel_hpd_trigger_irq called from dp_mst. Since dp_mst is suspended after irq handler uninstall, a cleaner approach is to cancel hpd work after intel_dp_mst_suspend, otherwise we risk use-after-free. I

[PATCH v4 2/3] drm/i915/fbdev: suspend HPD before fbdev unregistration

2022-07-20 Thread Andrzej Hajda
HPD event after fbdev unregistration can cause registration of deferred fbdev which will not be unregistered later, causing use-after-free. To avoid it HPD handling should be suspended before fbdev unregistration. It should fix following GPF: [272.634530] general protection fault, probably for non

[PATCH v4 3/3] drm/i915/display: add hotplug.suspended flag

2022-07-20 Thread Andrzej Hajda
HPD events during driver removal can be generated by hardware and software frameworks - drm_dp_mst, the former we can avoid by disabling interrupts, the latter can be triggered by any drm_dp_mst transaction, and this is too late. Introducing suspended flag allows to solve this chicken-egg problem.

Re: [PATCH v1 4/6] dma-buf: Acquire wait-wound context on attachment

2022-07-20 Thread Dmitry Osipenko
On 7/20/22 11:29, Christian König wrote: > Am 19.07.22 um 22:05 schrieb Dmitry Osipenko: >> On 7/15/22 09:59, Dmitry Osipenko wrote: >>> On 7/15/22 09:50, Christian König wrote: Am 15.07.22 um 02:52 schrieb Dmitry Osipenko: > Intel i915 GPU driver uses wait-wound mutex to lock multiple GEM

Re: [PATCH] drm/vmwgfx: clean up some error pointer checking

2022-07-20 Thread Zack Rusin
On Tue, 2022-07-19 at 12:47 +0300, Dan Carpenter wrote: > The vmw_user_bo_noref_lookup() function cannot return NULL. If it > could, then this function would return PTR_ERR(NULL) which is success. > Returning success without initializing "*vmw_bo_p = vmw_bo;" would > lead to an uninitialized varia

Re: [PATCH 1/7] drm/vmwgfx: Remove trailing whitespace

2022-07-20 Thread Zack Rusin
On Wed, 2022-07-20 at 10:30 +0200, Thomas Zimmermann wrote: > Fix coding style. No functional changes. > > Signed-off-by: Thomas Zimmermann Thanks! Reviewed-by: Zack Rusin

[PATCH RESEND 01/10] drm/amdgpu: use idr_init_base() to initialize mgr->ctx_handles

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-by: Danilo

[PATCH RESEND 05/10] drm: use idr_init_base() to initialize mode_config.object_idr

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 03/10] drm: use idr_init_base() to initialize master->magic_map

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 00/10] drm: use idr_init_base() over idr_init() if applicable

2022-07-20 Thread Danilo Krummrich
This patch series initializes IDRs with idr_init_base(&idr, 1) rather than idr_init(&idr) in case for the particular IDR no IDs < 1 are ever requested - this avoids unnecessary tree walks. Danilo Krummrich (10): drm/amdgpu: use idr_init_base() to initialize mgr->ctx_handles drm/amdgpu: use idr

[PATCH RESEND 09/10] drm/via: use idr_init_base() to initialize dev_priv->object_idr

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 08/10] drm/v3d: use idr_init_base() to initialize v3d_priv->perfmon.idr

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 06/10] drm: use idr_init_base() to initialize mode_config.tile_idr

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 02/10] drm/amdgpu: use idr_init_base() to initialize fpriv->bo_list_handles

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 04/10] drm: use idr_init_base() to initialize master->lessee_idr

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 07/10] drm/sis: use idr_init_base() to initialize dev_priv->object_idr

2022-07-20 Thread Danilo Krummrich
idr_init_base(), implemented by commit 6ce711f27500 ("idr: Make 1-based IDRs more efficient"), let us set an arbitrary base other than idr_init(), which uses base 0. Since, for this IDR, no ID < 1 is ever requested/allocated, using idr_init_base(&idr, 1) avoids unnecessary tree walks. Signed-off-

[PATCH RESEND 10/10] drm/todo: remove task for idr_init_base()

2022-07-20 Thread Danilo Krummrich
All IDRs in the DRM core and drivers which are applicable for using idr_init_base() over idr_init() should be set up to use a proper base in order to avoid unnecessary tree walks. Signed-off-by: Danilo Krummrich Acked-by: Christian König --- Documentation/gpu/todo.rst | 12 1 file

[PATCH RESEND 0/2] drm/virtio: use drm managed resources

2022-07-20 Thread Danilo Krummrich
This patch series converts plain memory allocations for driver structures and planes to drm managed allocations in order to cleanup/simply the corresponding release/destroy callbacks. Danilo Krummrich (2): drm/virtio: plane: use drm managed resources drm/virtio: kms: use drm managed resources

[PATCH RESEND 1/2] drm/virtio: plane: use drm managed resources

2022-07-20 Thread Danilo Krummrich
Use drm managed resource allocation (drmm_universal_plane_alloc()) in order to cleanup/simplify drm plane .destroy callback. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/virtio/virtgpu_plane.c | 30 +++--- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/

[PATCH RESEND 2/2] drm/virtio: kms: use drm managed resources

2022-07-20 Thread Danilo Krummrich
Allocate driver structures with drm managed resource allocators in order to cleanup/simplify the drm driver .release callback. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/virtio/virtgpu_kms.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu

[PATCH v2 04/10] drm/simpledrm: Compute framebuffer stride if not set

2022-07-20 Thread Thomas Zimmermann
Compute the framebuffer's scanline stride length if not given by the simplefb data. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/simpledrm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 7de477835d44.

[PATCH v2 02/10] drm/simpledrm: Inline device-init helpers

2022-07-20 Thread Thomas Zimmermann
Inline the helpers for initializing the hardware FB, the memory management and the modesetting into the device-creation function. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/simpledrm.c | 291 ++- 1 file changed, 128 insertions(+),

[PATCH v2 10/10] drm/ofdrm: Support color management

2022-07-20 Thread Thomas Zimmermann
Support the CRTC's color-management property and implement each model's palette support. The OF hardware has different methods of setting the palette. The respective code has been taken from fbdev's offb and refactored into per-model device functions. The device functions integrate this functional

[PATCH v2 07/10] drm/ofdrm: Add ofdrm for Open Firmware framebuffers

2022-07-20 Thread Thomas Zimmermann
Open Firmware provides basic display output via the 'display' node. DT platform code already provides a device that represents the node's framebuffer. Add a DRM driver for the device. The display mode and color format is pre-initialized by the system's firmware. Runtime modesetting via DRM is not p

[PATCH v2 03/10] drm/simpledrm: Remove pdev field from device structure

2022-07-20 Thread Thomas Zimmermann
Replace the remaining uses of the field pdev by upcasts from the Linux device and remove the field. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/simpledrm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/t

[PATCH v2 06/10] drm/simpledrm: Move some functionality into fwfb helper library

2022-07-20 Thread Thomas Zimmermann
Move some of simpledrm's functionality into a helper library. Other drivers for firmware-provided framebuffers will also need functions to handle fixed modes and color formats, or update the back buffer. Signed-off-by: Thomas Zimmermann --- Documentation/gpu/drm-kms-helpers.rst | 12 + MAINTAIN

[PATCH v2 00/10] drm: Add driver for PowerPC OF displays

2022-07-20 Thread Thomas Zimmermann
(was: drm: Add driverof PowerPC OF displays) PowerPC's Open Firmware offers a simple display buffer for graphics output. Add ofdrm, a DRM driver for the device. As with the existing simpledrm driver, the graphics hardware is pre-initialized by the firmware. The driver only provides blitting, no ac

[PATCH v2 01/10] drm/simpledrm: Remove mem field from device structure

2022-07-20 Thread Thomas Zimmermann
Remove the unused mem field from struct simpledrm_device. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/simpledrm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index 768242a78e2b..9fd507119372 100644 --- a/d

[PATCH v2 08/10] drm/ofdrm: Add CRTC state

2022-07-20 Thread Thomas Zimmermann
Add a dedicated CRTC state to ofdrm to later store information for palette updates. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/ofdrm.c | 62 ++-- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tiny/ofdrm.c b/drivers/g

[PATCH v2 09/10] drm/ofdrm: Add per-model device function

2022-07-20 Thread Thomas Zimmermann
Add a per-model device-function structure in preparation of adding color-management support. Detection of the individual models has been taken from fbdev's offb. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/ofdrm.c | 121 +++ 1 file changed, 121 inser

[PATCH v2 05/10] drm/simpledrm: Convert to atomic helpers

2022-07-20 Thread Thomas Zimmermann
Replace the simple-KMS helpers with the regular atomic helpers. The regular helpers are better architectured and therefore allow for easier code sharing among drivers. No functional changes. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/tiny/simpledrm.c | 283 -

Re: [RFC PATCH v3 04/19] KVM: x86: mmu: allow to enable write tracking externally

2022-07-20 Thread Maxim Levitsky
On Sun, 2022-05-22 at 13:22 +0300, Maxim Levitsky wrote: > On Thu, 2022-05-19 at 16:37 +, Sean Christopherson wrote: > > On Wed, Apr 27, 2022, Maxim Levitsky wrote: > > > @@ -5753,6 +5752,10 @@ int kvm_mmu_init_vm(struct kvm *kvm) > > > node->track_write = kvm_mmu_pte_write; > > >  

Re: [PATCH 0/7] drm: Clean up plane helpers

2022-07-20 Thread Sam Ravnborg
Hi Thomas, On Wed, Jul 20, 2022 at 10:30:51AM +0200, Thomas Zimmermann wrote: > The plane helpers are included by dozens of files without any need. Only > a hand full of source files need anything from drm_plane_helper.h. > > Untangle everything and tidy up the code a bit. The patches were built

Re: [PATCH RESEND 1/2] drm/virtio: plane: use drm managed resources

2022-07-20 Thread Sam Ravnborg
Hi Danilo, thanks for submitting this patch. On Wed, Jul 20, 2022 at 04:02:13PM +0200, Danilo Krummrich wrote: > Use drm managed resource allocation (drmm_universal_plane_alloc()) in > order to cleanup/simplify drm plane .destroy callback. > > Signed-off-by: Danilo Krummrich > --- > drivers/gp

Re: [PATCH RESEND 2/2] drm/virtio: kms: use drm managed resources

2022-07-20 Thread Sam Ravnborg
Hi Danilo, On Wed, Jul 20, 2022 at 04:02:14PM +0200, Danilo Krummrich wrote: > Allocate driver structures with drm managed resource allocators in order > to cleanup/simplify the drm driver .release callback. > > Signed-off-by: Danilo Krummrich This patch is already applied to drm-misc (drm-misc

[PATCH] gpu: ipu-v3: common: Add of_node_put() for reference returned by of_graph_get_port_by_id()

2022-07-20 Thread Liang He
In ipu_add_client_devices(), we need to call of_node_put() for reference returned by of_graph_get_port_by_id() in fail path. Fixes: 17e052175039 ("gpu: ipu-v3: Do not bail out on missing optional port nodes") Signed-off-by: Liang He --- In fact, there may be another problem in following code: '

[PATCH drm-misc-next v5 0/4] drm: rename CMA helpers to DMA helpers

2022-07-20 Thread Danilo Krummrich
This patch series renames all CMA helpers to DMA helpers - considering the hierarchy of APIs (mm/cma -> dma -> gem/fb dma helpers) calling them DMA helpers seems to be more applicable. Additionally, commit e57924d4ae80 ("drm/doc: Task to rename CMA helpers") requests to rename the CMA helpers and

[PATCH drm-misc-next v5 1/4] drm/fb: rename FB CMA helpers to FB DMA helpers

2022-07-20 Thread Danilo Krummrich
Rename "FB CMA" helpers to "FB DMA" helpers - considering the hierarchy of APIs (mm/cma -> dma -> fb dma) calling them "FB DMA" seems to be more applicable. Besides that, commit e57924d4ae80 ("drm/doc: Task to rename CMA helpers") requests to rename the CMA helpers and implies that people seem to

[PATCH v4 00/41] DYNDBG: opt-in class'd debug for modules, use in drm.

2022-07-20 Thread Jim Cromie
Oof, v3 had 2 copies renumbered and intermingled. Resending w/o the crud. v4 missed dri-devel & patchwork, sending there now. with doc tweak per Bagas. Its also at https://github.com/jimc/linux.git, in the dyn-drm-trc branch. Hi Jason, Greg, DRM-folk, This adds 'typed' "class FOO" support to dy

[PATCH v4 01/41] dyndbg: fix static_branch manipulation

2022-07-20 Thread Jim Cromie
In https://lore.kernel.org/lkml/20211209150910.ga23...@axis.com/ Vincent's patch commented on, and worked around, a bug toggling static_branch's, when a 2nd PRINTK-ish flag was added. The bug results in a premature static_branch_disable when the 1st of 2 flags was disabled. The cited commit comp

[PATCH v4 02/41] dyndbg: fix module.dyndbg handling

2022-07-20 Thread Jim Cromie
For CONFIG_DYNAMIC_DEBUG=N, the ddebug_dyndbg_module_param_cb() stub-fn is too permissive: bash-5.1# modprobe drm JUNKdyndbg bash-5.1# modprobe drm dyndbgJUNK [ 42.933220] dyndbg param is supported only in CONFIG_DYNAMIC_DEBUG builds [ 42.937484] ACPI: bus type drm_connector registered This c

[PATCH v4 03/41] dyndbg: show both old and new in change-info

2022-07-20 Thread Jim Cromie
print "old => new" flag values to the info("change") message. no functional change. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a56c1286ffa4..8faf584f2f4b 100644

[PATCH v4 04/41] dyndbg: reverse module walk in cat control

2022-07-20 Thread Jim Cromie
/proc/dynamic_debug/control walks the prdbg catalog in "reverse", fix this by adding new ddebug_tables to tail of list. This puts init/main.c entries 1st, which looks intentional. no functional changes. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v4 06/41] dyndbg: use ESCAPE_SPACE for cat control

2022-07-20 Thread Jim Cromie
`cat control` currently does octal escape, so '\n' becomes "\012". Change this to display as "\n" instead, which reads much cleaner. :#> head -n7 /proc/dynamic_debug/control # filename:lineno [module]function flags format init/main.c:1179 [main]initcall_blacklist =_ "blacklisting initcall

[PATCH v4 09/41] dyndbg: drop EXPORTed dynamic_debug_exec_queries

2022-07-20 Thread Jim Cromie
This exported fn is unused, and will not be needed. Lets dump it. The export was added to let drm control pr_debugs, as part of using them to avoid drm_debug_enabled overheads. But its better to just implement the drm.debug bitmap interface, then its available for everyone. Fixes: a2d375eda771 (

[PATCH v4 13/41] kernel/module: add __dyndbg_classes section

2022-07-20 Thread Jim Cromie
Like existing sections, particularly __dyndbg, this new one is an array/address and its length. In a close imitation of __dyndbg handling, these are defined, then passed around, as follows: vmlinux.lds.h: KEEP the new section, which also silences orphan section warning on loadable modules. Add

[PATCH v4 12/41] dyndbg: add DECLARE_DYNDBG_CLASSMAP

2022-07-20 Thread Jim Cromie
DECLARE_DYNDBG_CLASSMAP lets modules declare a set of classnames, this opt-in authorizes dyndbg to allow enabling of prdbgs by their class: :#> echo class DRM_UT_KMS +p > /proc/dynamic_debug/control This is just the setup; following commits deliver. The macro declares and initializes a static

[PATCH v4 19/41] doc-dyndbg: edit dynamic-debug-howto for brevity, audience

2022-07-20 Thread Jim Cromie
Rework/modernize docs: - use /proc/dynamic_debug/control in examples its *always* there (when dyndbg is config'd), even when is not. drop talk, its a distraction here. - alias ddcmd='echo $* > /proc/dynamic_debug/control declutter, hide boilerplate, focus on args - move Viewing bef

[PATCH v4 20/41] drm_print: condense enum drm_debug_category

2022-07-20 Thread Jim Cromie
enum drm_debug_category has 10 categories, but is initialized with bitmasks which require 10 bits of underlying storage. By using natural enumeration, and moving the BIT(cat) into drm_debug_enabled(), the enum fits in 4 bits, allowing the category to be represented directly in pr_debug callsites,

[PATCH v4 15/41] dyndbg: validate class FOO by checking with module

2022-07-20 Thread Jim Cromie
Add module-to-class validation: #> echo class DRM_UT_KMS +p > /proc/dynamic_debug/control If a query has "class FOO", then ddebug_find_valid_class(), called from ddebug_change(), requires that FOO is known to module X, otherwize the query is skipped entirely for X. This protects each module's

[PATCH v4 08/41] dyndbg: add test_dynamic_debug module

2022-07-20 Thread Jim Cromie
Provide a simple module to allow testing DYNAMIC_DEBUG behavior. It calls do_prints() from module-init, and with a sysfs-node. dmesg -C dmesg -w & modprobe test_dynamic_debug dyndbg=+p echo 1 > /sys/module/dynamic_debug/parameters/verbose cat /sys/module/test_dynamic_debug/parameters/d

[PATCH v4 21/41] drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.

2022-07-20 Thread Jim Cromie
Use DECLARE_DYNDBG_CLASSMAP across DRM: - in .c files, since macro defines/initializes a record - in drivers, $mod_{drv,drm,param}.c ie where param setup is done (since a class-bitmap is a param) - in drm/drm_print.c, since thats where it adds the class-bitmap, and replaces module_param

[PATCH v4 23/41] drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro

2022-07-20 Thread Jim Cromie
For CONFIG_DRM_USE_DYNAMIC_DEBUG=y, wrap __drm_dbg() & __drm_dev_dbg() in one of dyndbg's Factory macros: _dynamic_func_call_no_desc(). This adds the callsite descriptor into the code, and an entry for each into /proc/dynamic_debug/control. #> echo class DRM_UT_ATOMIC +p > /proc/dynamic_debug/c

[PATCH v4 10/41] dyndbg: add class_id to pr_debug callsites

2022-07-20 Thread Jim Cromie
DRM issues ~10 exclusive categories of debug messages; to represent this directly in dyndbg, add a new field: struct _ddebug.class_id:5. This gives us 32 classes, which is a practical usability limit with a bitmap interface: #> echo 0x012345678 > /sys/module/drm/parameters/debug All existing c

[PATCH v4 14/41] dyndbg: add ddebug_attach_module_classes

2022-07-20 Thread Jim Cromie
Add ddebug_attach_module_classes(), call it from ddebug_add_module(). It scans the classes/section its given, finds records where the module-name matches the module being added, and adds them to the module's maps list. No locking here, since the record isn't yet linked into the ddebug_tables list.

[PATCH v4 07/41] dyndbg: let query-modname override actual module name

2022-07-20 Thread Jim Cromie
dyndbg's control-parser: ddebug_parse_query(), requires that search terms: module, func, file, lineno, are used only once in a query; a thing cannot be named both foo and bar. The cited commit added an overriding module modname, taken from the module loader, which is authoritative. So it set quer

[PATCH v4 11/41] dyndbg: add __pr_debug_cls for testing

2022-07-20 Thread Jim Cromie
For selftest purposes, add __pr_debug_cls(class, fmt, ...) I didn't think we'd need to define this, since DRM effectively has it already in drm_dbg, drm_devdbg. But test_dynamic_debug needs it in order to demonstrate all the moving parts. Note the __ prefix; its not intended for general use, at

[PATCH v4 17/41] dyndbg: test DECLARE_DYNDBG_CLASSMAP, sysfs nodes

2022-07-20 Thread Jim Cromie
Demonstrate use of DECLARE_DYNDBG_CLASSMAP macro, and expose them as sysfs-nodes for testing. For each of the 4 class-map-types: - declare a class-map of that type, - declare the enum corresponding to those class-names - share _base across 0..30 range - add a __pr_debug_cls() call for eac

[PATCH v4 35/41] dyndbg: add 2 more trace-events: pr_debug, dev_dbg

2022-07-20 Thread Jim Cromie
ddebug_trace() currently issues a single printk:console event. Replace that, adding include/trace/events/dyndbg.h, which defines 2 new events: - dyndbg:prdbg - from trace_prdbg() - if !dev - dyndbg:devdbg - from trace_devdbg() - if !!dev This links the legacy pr_debug API to tracefs, via dyndbg

[PATCH v4 24/41] drm-print: add drm_dbg_driver to improve namespace symmetry

2022-07-20 Thread Jim Cromie
drm_print defines all of these: drm_dbg_{core,kms,prime,atomic,vbl,lease,_dp,_drmres} but not drm_dbg_driver itself, since it was the original drm_dbg. To improve namespace symmetry, change the drm_dbg defn to drm_dbg_driver, and redef grandfathered name to symmetric one. This will help with

[PATCH v4 29/41] nouveau: change nvkm_debug/trace to use dev_dbg POC

2022-07-20 Thread Jim Cromie
These 2 macros formerly used dev_info, and they still check subdev->debug to gate the printing. So dyndbg control is redundant ATM (and possibly confusing, since its off by default). prdbg count is up from 3, or from 65 (with VMM_DEBUG here) [7.765379] dyndbg: 516 debug prints in module nouv

  1   2   >