[PATCH v2 2/3] drm/i915/gt: Serialize GRDOM access between multiple engine resets

2022-06-29 Thread Mauro Carvalho Chehab
From: Chris Wilson Don't allow two engines to be reset in parallel, as they would both try to select a reset bit (and send requests to common registers) and wait on that register, at the same time. Serialize control of the reset requests/acks using the uncore->lock, which will also ensure that

Re: [PATCH v5 1/9] dt-bindings: usb: Add Type-C switch binding

2022-06-29 Thread Pin-yen Lin
On Wed, Jun 29, 2022 at 10:33 PM Pin-yen Lin wrote: > > On Wed, Jun 29, 2022 at 2:23 AM Rob Herring wrote: > > > > On Mon, Jun 27, 2022 at 02:43:39PM -0700, Prashant Malani wrote: > > > Hello Rob, > > > > > > On Mon, Jun 27, 2022 at 2:04 PM Rob Herring wrote: > > > > > > > > On Wed, Jun 22,

Re: [PATCH 0/1] [RFC] drm/fourcc: Add new unsigned R16_UINT/RG1616_UINT formats

2022-06-29 Thread Simon Ser
On Wednesday, June 29th, 2022 at 16:46, Dennis Tsiang wrote: > Thanks for your comments. This is not intended to be used for KMS, where > indeed there would be no difference. This proposal is for other Graphics > APIs such as Vulkan, which requires the application to be explicit > upfront about

Re: [PATCH 0/1] [RFC] drm/fourcc: Add new unsigned R16_UINT/RG1616_UINT formats

2022-06-29 Thread Dennis Tsiang
On 27/06/2022 15:50, Pekka Paalanen wrote: On Mon, 27 Jun 2022 13:40:04 + Dennis Tsiang wrote: This patch is an early RFC to discuss the viable options and alternatives for inclusion of unsigned integer formats for the DRM API. This patch adds a new single component 16-bit and a two

Re: [PATCH v3 03/71] drm/encoder: Introduce drmm_encoder_init

2022-06-29 Thread Maxime Ripard
On Wed, Jun 29, 2022 at 03:32:12PM +0200, Philipp Zabel wrote: > On Mi, 2022-06-29 at 14:34 +0200, Maxime Ripard wrote: > > The DRM-managed function to register an encoder is > > drmm_encoder_alloc() and its variants, which will allocate the underlying > > structure and initialisation the encoder.

Re: [PATCH v5 1/9] dt-bindings: usb: Add Type-C switch binding

2022-06-29 Thread Pin-yen Lin
On Wed, Jun 29, 2022 at 2:23 AM Rob Herring wrote: > > On Mon, Jun 27, 2022 at 02:43:39PM -0700, Prashant Malani wrote: > > Hello Rob, > > > > On Mon, Jun 27, 2022 at 2:04 PM Rob Herring wrote: > > > > > > On Wed, Jun 22, 2022 at 05:34:30PM +, Prashant Malani wrote: > > > > Introduce a

Re: [PATCH 6/6] i2c: Make remove callback return void

2022-06-29 Thread Maximilian Luz
On 6/28/22 16:03, Uwe Kleine-König wrote: From: Uwe Kleine-König The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value.

RE: [v3 3/5] drm/bridge: add psr support during panel bridge enable & disable sequence

2022-06-29 Thread Sankeerth Billakanti (QUIC)
Hi Dmitry, >On 21/06/2022 13:53, Vinod Polimera wrote: >> This change avoids panel prepare/unprepare based on self-refresh >> state. >> >> Signed-off-by: Sankeerth Billakanti >> Signed-off-by: Kalyan Thota >> Signed-off-by: Vinod Polimera >> --- >> drivers/gpu/drm/bridge/panel.c | 102

Re: [PATCH 0/4] Add Toshiba Visconti DNN image processing accelerator driver

2022-06-29 Thread Hans Verkuil
My apologies for the late reply... On 01/06/2022 03:40, yuji2.ishik...@toshiba.co.jp wrote: > Hi Hans, > > Thank you for your advice. > I prepared some description of DNN accelerator and its usage. > > Handling memory blocks for Visconti5 accelerators > > Visconti5

[Bug 216119] 087451f372bf76d breaks hibernation on amdgpu Radeon R9 390

2022-06-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216119 --- Comment #31 from Harald Judt (h.j...@gmx.at) --- Created attachment 301306 --> https://bugzilla.kernel.org/attachment.cgi?id=301306=edit dmesg.out amdgpu.dc=0 doesn't seem to make any practical difference. BTW: With the new patchset, the

RE: [v3 1/5] drm/msm/dp: Add basic PSR support for eDP

2022-06-29 Thread Sankeerth Billakanti (QUIC)
Hi Dmitry, >On 21/06/2022 13:53, Vinod Polimera wrote: >> Add support for basic panel self refresh (PSR) feature for eDP. >> Add a new interface to set PSR state in the sink from DPU. >> Program the eDP controller to issue PSR enter and exit SDP to the >> sink. >> >> Signed-off-by: Sankeerth

Re: [PATCH 6/6] i2c: Make remove callback return void

2022-06-29 Thread Uwe Kleine-König
[Dropped most people from Cc, keeping only lists] On Wed, Jun 29, 2022 at 04:11:26PM +0300, Andrey Ryabinin wrote: > On 6/28/22 17:03, Uwe Kleine-König wrote: > > From: Uwe Kleine-König > > > > The value returned by an i2c driver's remove function is mostly ignored. > > (Only an error message is

Re: [RESEND RFC 00/18] drm/display/dp_mst: Drop Radeon MST support, make MST atomic-only

2022-06-29 Thread Jani Nikula
On Tue, 07 Jun 2022, Lyude Paul wrote: > Ugh, thanks ./scripts/get_maintainers.pl for confusing and breaking > git-send email <<. Sorry for the resend everyone. > > For quite a while we've been carrying around a lot of legacy modesetting > code in the MST helpers that has been rather annoying to

Re: [PATCH v3 03/71] drm/encoder: Introduce drmm_encoder_init

2022-06-29 Thread Philipp Zabel
On Mi, 2022-06-29 at 14:34 +0200, Maxime Ripard wrote: > The DRM-managed function to register an encoder is > drmm_encoder_alloc() and its variants, which will allocate the underlying > structure and initialisation the encoder. > > However, we might want to separate the structure creation and the

Re: [RESEND RFC 08/18] drm/display/dp_mst: Add nonblocking helpers for DP MST

2022-06-29 Thread Jani Nikula
On Tue, 07 Jun 2022, Lyude Paul wrote: > As Daniel Vetter pointed out, if we only use the atomic modesetting locks > with MST it's technically possible for a driver with non-blocking modesets > to race when it comes to MST displays - as we make the mistake of not doing > our own CRTC commit

[Bug 216119] 087451f372bf76d breaks hibernation on amdgpu Radeon R9 390

2022-06-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216119 --- Comment #30 from Harald Judt (h.j...@gmx.at) --- I will have to test this. I have not known this option exists and what it does nor what will happen if I disable it and if that is good or bad, so I have never used it before. -- You may

Re: [RESEND RFC 07/18] drm/display/dp_mst: Add helper for finding payloads in atomic MST state

2022-06-29 Thread Jani Nikula
On Tue, 07 Jun 2022, Lyude Paul wrote: > We already open-code this quite often, and will be iterating through > payloads even more once we've moved all of the payload tracking into the > atomic state. So, let's add a helper for doing this. > > Signed-off-by: Lyude Paul > Cc: Wayne Lin > Cc:

Re: [PATCH AUTOSEL 4.9 08/13] video: fbdev: simplefb: Check before clk_put() not needed

2022-06-29 Thread Pavel Machek
Hi! > [ Upstream commit 5491424d17bdeb7b7852a59367858251783f8398 ] > > clk_put() already checks the clk ptr using !clk and IS_ERR() > so there is no need to check it again before calling it. Nice cleanup, but not a bugfix; we don't need it in -stable. Best regards,

Re: [PATCH AUTOSEL 4.9 05/13] video: fbdev: skeletonfb: Fix syntax errors in comments

2022-06-29 Thread Pavel Machek
Hi! > From: Xiang wangx > > [ Upstream commit fc378794a2f7a19cf26010dc33b89ba608d4c70f ] > > Delete the redundant word 'its'. Calling typo in comment "syntax error" is ... interesting. Anyway, we don't need this in stable. Best regards,

Re: [PATCH AUTOSEL 4.19 04/22] drm/vc4: crtc: Use an union to store the page flip callback

2022-06-29 Thread Pavel Machek
Hi! > From: Maxime Ripard > > [ Upstream commit 2523e9dcc3be91bf9fdc0d1e542557ca00bbef42 ] > > We'll need to extend the vc4_async_flip_state structure to rely on > another callback implementation, so let's move the current one into a > union. This and [04/22] drm/vc4: crtc: Use an union to

[Bug 216173] amdgpu [gfxhub] page fault (src_id:0 ring:173 vmid:1 pasid:32769, for process Xorg pid 2994 thread Xorg:cs0 pid 3237)

2022-06-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216173 --- Comment #10 from Alex Deucher (alexdeuc...@gmail.com) --- Duplicate of: https://bugzilla.kernel.org/show_bug.cgi?id=216120 https://gitlab.freedesktop.org/drm/amd/-/issues/2050 -- You may reply to this email to add a comment. You are

Re: [PATCH v3 08/71] drm/connector: Check for destroy implementation

2022-06-29 Thread Jani Nikula
On Wed, 29 Jun 2022, Maxime Ripard wrote: > Connectors need to be cleaned up with a call to drm_connector_cleanup() > in their drm_connector_funcs.destroy implementation. > > Let's check for this and complain if there's no such function. > > Signed-off-by: Maxime Ripard > --- >

[Bug 216119] 087451f372bf76d breaks hibernation on amdgpu Radeon R9 390

2022-06-29 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216119 --- Comment #29 from Alex Deucher (alexdeuc...@gmail.com) --- Do they also work when you set amdgpu.dc=0 or has that always had problems for you? -- You may reply to this email to add a comment. You are receiving this mail because: You are

Re: [PATCH v3 12/13] drm/i915/ttm: disallow CPU fallback mode for ccs pages

2022-06-29 Thread Ramalingam C
On 2022-06-29 at 13:14:26 +0100, Matthew Auld wrote: > Falling back to memcpy/memset shouldn't be allowed if we know we have > CCS state to manage using the blitter. Otherwise we are potentially > leaving the aux CCS state in an unknown state, which smells like an info > leak. > > Fixes:

[PATCH v3 60/71] drm/vc4: vec: Switch to DRM-managed encoder initialization

2022-06-29 Thread Maxime Ripard
The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves

[PATCH v3 71/71] drm/vc4: v3d: Switch to devm_pm_runtime_enable

2022-06-29 Thread Maxime Ripard
devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_v3d.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git

[PATCH v3 68/71] drm/vc4: perfmon: Add missing mutex_destroy

2022-06-29 Thread Maxime Ripard
vc4_perfmon_open_file() will instantiate a mutex for that file instance, but we never call mutex_destroy () in vc4_perfmon_close_file(). Let's add that missing call. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_perfmon.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v3 70/71] drm/vc4: v3d: Rework the runtime_pm setup

2022-06-29 Thread Maxime Ripard
At bind time, vc4_v3d_bind() will read a register to retrieve the v3d version and make sure it's a version we're compatible with. However, the v3d has an optional clock that is enabled only after the register read-out and a power domain that wasn't enabled at all in the bind implementation. This

[PATCH v3 65/71] drm/vc4: debugfs: Return an error on failure

2022-06-29 Thread Maxime Ripard
vc4_debugfs_add_file() can fail, so let's propagate its error code instead of silencing it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_debugfs.c | 20 +++- drivers/gpu/drm/vc4/vc4_drv.h | 30 -- 2 files changed, 27 insertions(+), 23

[PATCH v3 69/71] drm/vc4: v3d: Stop disabling interrupts

2022-06-29 Thread Maxime Ripard
The vc4_irq_disable(), among other things, will call disable_irq() to complete any in-flight interrupts. This requires its counterpart, vc4_irq_enable(), to call enable_irq() which causes issues addressed in a later patch. However, vc4_irq_disable() is called by two callees: vc4_irq_uninstall()

[PATCH v3 61/71] drm/vc4: vec: Switch to DRM-managed connector initialization

2022-06-29 Thread Maxime Ripard
The current code will call drm_connector_unregister() and drm_connector_cleanup() when the device is unbound. However, by then, there might still be some references held to that connector, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed

[PATCH v3 67/71] drm/vc4: Switch to drmm_mutex_init

2022-06-29 Thread Maxime Ripard
mutex_init is supposed to be balanced by a call to mutex_destroy that we were never doing in the vc4 driver. Since a DRM-managed mutex_init variant has been introduced, let's just switch to it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_bo.c | 15 +--

[PATCH v3 66/71] drm/vc4: debugfs: Simplify debugfs registration

2022-06-29 Thread Maxime Ripard
The vc4 has a custom API to allow components to register a debugfs file before the DRM driver has been registered and the debugfs_init hook has been called. However, the .late_register hook allows to have the debugfs file creation deferred after that time already. Let's remove our custom code to

[PATCH v3 55/71] drm/vc4: txp: Protect device resources

2022-06-29 Thread Maxime Ripard
Our current code now mixes some resources whose lifetime are tied to the device (clocks, IO mappings, etc.) and some that are tied to the DRM device (encoder, bridge). The device one will be freed at unbind time, but the DRM one will only be freed when the last user of the DRM device closes its

[PATCH v3 62/71] drm/vc4: vec: Protect device resources after removal

2022-06-29 Thread Maxime Ripard
Whenever the device and driver are unbound, the main device and all the subdevices will be removed by calling their unbind() method. However, the DRM device itself will only be freed when the last user will have closed it. It means that there is a time window where the device and its resources

[PATCH v3 63/71] drm/vc4: vec: Switch to devm_pm_runtime_enable

2022-06-29 Thread Maxime Ripard
devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_vec.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git

[PATCH v3 64/71] drm/vc4: debugfs: Protect device resources

2022-06-29 Thread Maxime Ripard
Our current code now mixes some resources whose lifetime are tied to the device (clocks, IO mappings, etc.) and some that are tied to the DRM device (encoder, bridge). The device one will be freed at unbind time, but the DRM one will only be freed when the last user of the DRM device closes its

[PATCH v3 59/71] drm/vc4: vec: Remove call to drm_connector_unregister()

2022-06-29 Thread Maxime Ripard
drm_connector_unregister() is only to be used for connectors that have been registered through drm_connector_register() after drm_dev_register() has been called. This is our case here so let's remove the call. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_vec.c | 10 ++ 1

[PATCH v3 56/71] drm/vc4: vec: Remove vc4_dev vec pointer

2022-06-29 Thread Maxime Ripard
There's no user for that pointer so let's just get rid of it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_drv.h | 1 - drivers/gpu/drm/vc4/vc4_vec.c | 7 --- 2 files changed, 8 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index

[PATCH v3 58/71] drm/vc4: vec: Switch to drmm_kzalloc

2022-06-29 Thread Maxime Ripard
Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and

[PATCH v3 57/71] drm/vc4: vec: Embed DRM structures into the private structure

2022-06-29 Thread Maxime Ripard
The VC4 VEC driver private structure contains only a pointer to the encoder and connector it implements. This makes the overall structure somewhat inconsistent with the rest of the driver, and complicates its initialisation without any apparent gain. Let's embed the drm_encoder structure (through

[PATCH v3 53/71] drm/vc4: txp: Switch to drmm_kzalloc

2022-06-29 Thread Maxime Ripard
Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and

[PATCH v3 50/71] drm/vc4: hdmi: Switch to devm_pm_runtime_enable

2022-06-29 Thread Maxime Ripard
devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git

[PATCH v3 54/71] drm/vc4: txp: Remove call to drm_connector_unregister()

2022-06-29 Thread Maxime Ripard
drm_connector_unregister() is only to be used for connectors that have been registered through drm_connector_register() after drm_dev_register() has been called. This is our case here so let's remove the call. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_txp.c | 10 ++ 1

[PATCH v3 52/71] drm/vc4: txp: Remove duplicate regset

2022-06-29 Thread Maxime Ripard
There's already a regset in the vc4_crtc structure so there's no need to duplicate it in vc4_txp. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_txp.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git

[PATCH v3 48/71] drm/vc4: hdmi: Move audio structure offset checks

2022-06-29 Thread Maxime Ripard
The HDMI driver unbind hook doesn't have any ALSA-related code anymore, so let's move the ALSA sanity checks and comments we have to some other part of the driver dedicated to ALSA. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 40 +- 1 file

[PATCH v3 51/71] drm/vc4: txp: Remove vc4_dev txp pointer

2022-06-29 Thread Maxime Ripard
There's no user for that pointer so let's just get rid of it. Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_drv.h | 1 - drivers/gpu/drm/vc4/vc4_txp.c | 6 -- 2 files changed, 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h

[PATCH v3 47/71] drm/vc4: hdmi: Use devm to register hotplug interrupts

2022-06-29 Thread Maxime Ripard
Commit 776efe800fed ("drm/vc4: hdmi: Drop devm interrupt handler for hotplug interrupts") dropped the device-managed interrupt registration because it was creating bugs and races whenever an interrupt was coming in while the device was removed. However, our latest patches to the HDMI controller

[PATCH v3 46/71] drm/vc4: hdmi: Switch to DRM-managed kfree to build regsets

2022-06-29 Thread Maxime Ripard
The current code to build the registers set later exposed in debugfs for the HDMI controller relies on traditional allocations, that are later free'd as part of the driver unbind hook. Since krealloc doesn't have a DRM-managed equivalent, let's add an action to free the buffer later on.

[PATCH v3 49/71] drm/vc4: hdmi: Protect device resources after removal

2022-06-29 Thread Maxime Ripard
Whenever the device and driver are unbound, the main device and all the subdevices will be removed by calling their unbind() method. However, the DRM device itself will only be freed when the last user will have closed it. It means that there is a time window where the device and its resources

[PATCH v3 44/71] drm/vc4: hdmi: Switch to device-managed CEC initialization

2022-06-29 Thread Maxime Ripard
The current code to unregister our CEC device needs to be undone manually when we remove the HDMI driver. Since the CEC framework will allocate its main structure, and will defer its deallocation to when the last user will have closed it, we don't really need to take any particular measure to

[PATCH v3 45/71] drm/vc4: hdmi: Use a device-managed action for DDC

2022-06-29 Thread Maxime Ripard
The reference to the DDC controller device needs to be put back when we're done with it. Let's use a device-managed action to simplify the driver. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff

[PATCH v3 43/71] drm/vc4: hdmi: Switch to device-managed ALSA initialization

2022-06-29 Thread Maxime Ripard
The current code to unregister our ALSA device needs to be undone manually when we remove the HDMI driver. Since ALSA doesn't seem to support any mechanism to defer freeing something until the last user of the ALSA device is gone, we can either use a device-managed or a DRM-managed action. The

[PATCH v3 42/71] drm/vc4: hdmi: Switch to DRM-managed connector initialization

2022-06-29 Thread Maxime Ripard
The current code will call drm_connector_unregister() and drm_connector_cleanup() when the device is unbound. However, by then, there might still be some references held to that connector, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed

[PATCH v3 41/71] drm/vc4: hdmi: Switch to DRM-managed encoder initialization

2022-06-29 Thread Maxime Ripard
The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves

[PATCH v3 35/71] drm/vc4: dsi: Fix the driver structure lifetime

2022-06-29 Thread Maxime Ripard
The vc4_dsi structure is currently allocated through a device-managed allocation. This can lead to use-after-free issues however in the unbinding path since the DRM entities will stick around, but the underlying structure has been freed. However, we can't just fix it by using a DRM-managed

[PATCH v3 39/71] drm/vc4: hdmi: Switch to drmm_kzalloc

2022-06-29 Thread Maxime Ripard
Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and

[PATCH v3 37/71] drm/vc4: hdmi: Depends on CONFIG_PM

2022-06-29 Thread Maxime Ripard
We already depend on runtime PM to get the power domains and clocks for most of the devices supported by the vc4 driver, so let's just select it to make sure it's there. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/Kconfig| 1 + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- 2 files

[PATCH v3 38/71] drm/vc4: hdmi: Rework power up

2022-06-29 Thread Maxime Ripard
The current code tries to handle the case where CONFIG_PM isn't selected by first calling our runtime_resume implementation and then properly report the power state to the runtime_pm core. This allows to have a functionning device even if pm_runtime_get_* functions are nops. However, the device

[PATCH v3 34/71] drm/vc4: dsi: Switch to drmm_of_get_bridge

2022-06-29 Thread Maxime Ripard
The current code uses a device-managed function to retrieve the next bridge downstream. However, that means that it will be removed at unbind time, where the DRM device is still very much live and might still have some applications that still have it open. Switch to a DRM-managed variant to

[PATCH v3 40/71] drm/vc4: hdmi: Remove call to drm_connector_unregister()

2022-06-29 Thread Maxime Ripard
drm_connector_unregister() is only to be used for connectors that have been registered through drm_connector_register() after drm_dev_register() has been called. This is our case here so let's remove the call. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 12 +++- 1

[PATCH v3 25/71] drm/vc4: dpi: Switch to drmm_kzalloc

2022-06-29 Thread Maxime Ripard
Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and

[PATCH v3 33/71] drm/vc4: dsi: Switch to DRM-managed encoder initialization

2022-06-29 Thread Maxime Ripard
The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves

[PATCH v3 31/71] drm/vc4: dpi: Protect device resources

2022-06-29 Thread Maxime Ripard
Our current code now mixes some resources whose lifetime are tied to the device (clocks, IO mappings, etc.) and some that are tied to the DRM device (encoder, bridge). The device one will be freed at unbind time, but the DRM one will only be freed when the last user of the DRM device closes its

[PATCH v3 36/71] drm/vc4: dsi: Switch to devm_pm_runtime_enable

2022-06-29 Thread Maxime Ripard
devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_dsi.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v3 26/71] drm/vc4: dpi: Return an error if we can't enable our clock

2022-06-29 Thread Maxime Ripard
If we fail to enable the DPI clock, we just ignore the error and moves forward. Let's return an error instead. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_dpi.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH v3 32/71] drm/vc4: dsi: Embed DRM structures into the private structure

2022-06-29 Thread Maxime Ripard
The VC4 DSI driver private structure contains only a pointer to the encoder it implements. This makes the overall structure somewhat inconsistent with the rest of the driver, and complicates its initialisation without any apparent gain. Let's embed the drm_encoder structure (through the

[PATCH v3 29/71] drm/vc4: dpi: Switch to DRM-managed encoder initialization

2022-06-29 Thread Maxime Ripard
The current code will call drm_encoder_cleanup() when the device is unbound. However, by then, there might still be some references held to that encoder, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves

[PATCH v3 28/71] drm/vc4: dpi: Add action to disable the clock

2022-06-29 Thread Maxime Ripard
The DPI controller has two clocks called core and pixel, the core clock being enabled at bind time. Adding a device-managed action will make the error path easier, so let's create one to disable it. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_dpi.c |

[PATCH v3 30/71] drm/vc4: dpi: Switch to drmm_of_get_bridge

2022-06-29 Thread Maxime Ripard
The current code uses a device-managed function to retrieve the next bridge downstream. However, that means that it will be removed at unbind time, where the DRM device is still very much live and might still have some applications that still have it open. Switch to a DRM-managed variant to

[PATCH v3 23/71] drm/vc4: dpi: Remove vc4_dev dpi pointer

2022-06-29 Thread Maxime Ripard
There's no user for that pointer so let's just get rid of it. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_dpi.c | 7 --- drivers/gpu/drm/vc4/vc4_drv.h | 1 - 2 files changed, 8 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c

[PATCH v3 27/71] drm/vc4: dpi: Remove unnecessary drm_of_panel_bridge_remove call

2022-06-29 Thread Maxime Ripard
Since we have a managed call to create our panel_bridge instance, the call to drm_of_panel_bridge_remove() at unbind is both redundant and dangerous since it might lead to a use-after-free. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_dpi.c | 2 -- 1

[PATCH v3 24/71] drm/vc4: dpi: Embed DRM structures into the private structure

2022-06-29 Thread Maxime Ripard
The VC4 DPI driver private structure contains only a pointer to the encoder it implements. This makes the overall structure somewhat inconsistent with the rest of the driver, and complicates its initialisation without any apparent gain. Let's embed the drm_encoder structure (through the

[PATCH v3 18/71] drm/vc4: crtc: Remove manual plane removal on error

2022-06-29 Thread Maxime Ripard
When vc4_crtc_bind() fails after vc4_crtc_init() has been called, we have a loop undoing the plane creation and calling destroy on each plane registered and matching the possible_crtcs mask. However, this is redundant with what drm_mode_config_cleanup() is doing, so let's remove it.

[PATCH v3 22/71] drm/vc4: crtc: Switch to DRM-managed CRTC initialization

2022-06-29 Thread Maxime Ripard
The current code will call drm_crtc_cleanup() when the device is unbound. However, by then, there might still be some references held to that CRTC, including by the userspace that might still have the DRM device open. Let's switch to a DRM-managed initialization to clean up after ourselves only

[PATCH v3 19/71] drm/vc4: plane: Switch to drmm_universal_plane_alloc()

2022-06-29 Thread Maxime Ripard
Let's switch to drmm_universal_plane_alloc() for our plane allocation and initialisation to make the driver a bit simpler. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_crtc.c | 1 - drivers/gpu/drm/vc4/vc4_plane.c | 23 --- 2 files

[PATCH v3 20/71] drm/vc4: crtc: Move debugfs_name to crtc_data

2022-06-29 Thread Maxime Ripard
All the CRTCs, including the TXP, have a debugfs file and name so we can consolidate it into vc4_crtc_data. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_crtc.c | 18 +- drivers/gpu/drm/vc4/vc4_drv.h | 4 ++--

[PATCH v3 21/71] drm/vc4: crtc: Switch to drmm_kzalloc

2022-06-29 Thread Maxime Ripard
Our internal structure that stores the DRM entities structure is allocated through a device-managed kzalloc. This means that this will eventually be freed whenever the device is removed. In our case, the most likely source of removal is that the main device is going to be unbound, and

[PATCH v3 17/71] drm/vc4: plane: Take possible_crtcs as an argument

2022-06-29 Thread Maxime Ripard
vc4_plane_init() currently initialises the plane with no possible CRTCs, and will expect the caller to set it up by itself. Let's change that logic a bit to follow the syntax of drm_universal_plane_init() and pass the possible CRTCs bitmask as an argument to the function instead. Reviewed-by:

[PATCH v3 14/71] drm/vc4: crtc: Create vblank reporting function

2022-06-29 Thread Maxime Ripard
We'll need that code in the HVS driver, so let's create a shared function to reuse it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_crtc.c | 23 +++ drivers/gpu/drm/vc4/vc4_drv.h | 1 + 2 files changed, 16 insertions(+), 8 deletions(-) diff --git

[PATCH v3 08/71] drm/connector: Check for destroy implementation

2022-06-29 Thread Maxime Ripard
Connectors need to be cleaned up with a call to drm_connector_cleanup() in their drm_connector_funcs.destroy implementation. Let's check for this and complain if there's no such function. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_connector.c | 6 ++ 1 file changed, 6

[PATCH v3 16/71] drm/vc4: hvs: Remove planes currently allocated before taking down

2022-06-29 Thread Maxime Ripard
When the HVS driver is unbound, a lot of memory allocations in the LBM and DLIST RAM are still assigned to planes that are still allocated. Thus, we hit a warning when calling drm_mm_takedown() since the memory pool is not completely free of allocations. Let's free all the currently live entries

[PATCH v3 15/71] drm/vc4: hvs: Protect device resources after removal

2022-06-29 Thread Maxime Ripard
Whenever the device and driver are unbound, the main device and all the subdevices will be removed by calling their unbind() method. However, the DRM device itself will only be freed when the last user will have closed it. It means that there is a time window where the device and its resources

[PATCH v3 13/71] drm/vc4: drv: Use drm_dev_unplug

2022-06-29 Thread Maxime Ripard
When our KMS driver is unbound, the device is no longer there but we might still have users with an opened fd to the KMS device. To avoid any issue in such a situation, every device access needs to be protected by calls to drm_dev_enter() and drm_dev_exit(), and the driver needs to call

[PATCH v3 12/71] drm/vc4: drv: Call component_unbind_all()

2022-06-29 Thread Maxime Ripard
While we were using the component framework to deal with all the DRM subdevices, we were not calling component_unbind_all(). This leads to none of the subdevices freeing up their resources as part of their unbind() or device managed hooks. Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for

[PATCH v3 11/71] drm/bridge: panel: Introduce drmm_of_get_bridge

2022-06-29 Thread Maxime Ripard
Unlike what can be found for other DRM entities, we don't have a DRM-managed function equivalent to devm_drm_of_get_bridge(). Let's create it. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard --- drivers/gpu/drm/bridge/panel.c | 35 ++

[PATCH v3 07/71] drm/connector: Consolidate Connector Initialization

2022-06-29 Thread Maxime Ripard
We're going to add a DRM-managed connector initialization function. Since we'll need both the with and without the DDC pointer, having a single function that takes an optional pointer is easier to maintain. Let's create a static function that will back both existing variants, and will be reused

[PATCH v3 09/71] drm/connector: Introduce drmm_connector_init

2022-06-29 Thread Maxime Ripard
Unlike other DRM entities, there's no helper to create a DRM-managed initialisation of a connector. Let's create an helper to initialise a connector that would be passed as an argument, and handle the cleanup through a DRM-managed action. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann

[PATCH v3 10/71] drm/bridge: panel: Introduce drmm_panel_bridge_add

2022-06-29 Thread Maxime Ripard
Unlike what can be found for other entities, there's no DRM-managed function to create a panel_bridge instance from a panel. Let's introduce one. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard --- drivers/gpu/drm/bridge/panel.c | 39 ++

[PATCH v3 05/71] drm/connector: Mention the cleanup after drm_connector_init

2022-06-29 Thread Maxime Ripard
Unlike encoders and CRTCs, the drm_connector_init() and drm_connector_init_with_ddc() don't mention how the cleanup is supposed to be done. Let's add it. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_connector.c | 8 1 file changed, 8 insertions(+) diff

[PATCH v3 03/71] drm/encoder: Introduce drmm_encoder_init

2022-06-29 Thread Maxime Ripard
The DRM-managed function to register an encoder is drmm_encoder_alloc() and its variants, which will allocate the underlying structure and initialisation the encoder. However, we might want to separate the structure creation and the encoder initialisation, for example if the structure is shared

[PATCH v3 06/71] drm/connector: Clarify when drm_connector_unregister is needed

2022-06-29 Thread Maxime Ripard
The current documentation for drm_connector_unregister() mentions that it's needed for connectors that have been registered through drm_dev_register(). However, this was a typo and was meant to be drm_connector_register(), which only applies to connectors registered after drm_dev_register() has

[PATCH v3 04/71] drm/connector: Reorder headers

2022-06-29 Thread Maxime Ripard
Unlike most of the other files in DRM, and Linux in general, the headers in drm_connector.c aren't sorted alphabetically. Let's fix that. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_connector.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v3 02/71] drm/crtc: Introduce drmm_crtc_init_with_planes

2022-06-29 Thread Maxime Ripard
The DRM-managed function to register a CRTC is drmm_crtc_alloc_with_planes(), which will allocate the underlying structure and initialisation the CRTC. However, we might want to separate the structure creation and the CRTC initialisation, for example if the structure is shared across multiple DRM

[PATCH v3 01/71] drm/mipi-dsi: Detach devices when removing the host

2022-06-29 Thread Maxime Ripard
Whenever the MIPI-DSI host is unregistered, the code of mipi_dsi_host_unregister() loops over every device currently found on that bus and will unregister it. However, it doesn't detach it from the bus first, which leads to all kind of resource leaks if the host wants to perform some clean up

[PATCH v3 00/71] drm/vc4: Fix hotplug for vc4

2022-06-29 Thread Maxime Ripard
-20220629 - Fix va arguments on the crtc and encoder init - Removed drmm_connector_init_with_ddc and consolidated drm_connector_init* - Reworked the doc for drmm_of_get_bridge Changes from v1: - Rebased on top on next-20220622 - Consolidated the new drmm init helpers with their alloc

Re: [PATCH v2 1/2] procfs: Add 'size' to /proc//fdinfo/

2022-06-29 Thread Brian Foster
On Tue, Jun 28, 2022 at 03:38:02PM -0700, Kalesh Singh wrote: > On Tue, Jun 28, 2022 at 4:54 AM Brian Foster wrote: > > > > On Thu, Jun 23, 2022 at 03:06:06PM -0700, Kalesh Singh wrote: > > > To be able to account the amount of memory a process is keeping pinned > > > by open file descriptors add

[PATCH v3 08/13] drm/i915/uapi: tweak error capture on recoverable contexts

2022-06-29 Thread Matthew Auld
A non-recoverable context must be used if the user wants proper error capture on discrete platforms. In the future the kernel may want to blit the contents of some objects when later doing the capture stage. Also extend to newer integrated platforms. v2(Thomas): - Also extend to newer

[PATCH v3 11/13] drm/i915/ttm: handle blitter failure on DG2

2022-06-29 Thread Matthew Auld
If the move or clear operation somehow fails, and the memory underneath is not cleared, like when moving to lmem, then we currently fallback to memcpy or memset. However with small-BAR systems this fallback might no longer be possible. For now we use the set_wedged sledgehammer if we ever

[PATCH v3 10/13] drm/i915/selftests: ensure we reserve a fence slot

2022-06-29 Thread Matthew Auld
We should always be explicit and allocate a fence slot before adding a new fence. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Lionel Landwerlin Cc: Tvrtko Ursulin Cc: Jon Bloomfield Cc: Daniel Vetter Cc: Jordan Justen Cc: Kenneth Graunke Cc: Akeem G Abodunrin Reviewed-by: Thomas

<    1   2   3   >