Re: [PATCH] drm/nouveau: fix null pointer dereference in nouveau_connector_get_modes

2024-06-26 Thread Jani Nikula
ev, nv_connector->native_mode); > + if (!mode) > + return -ENOMEM; Do not return negative values from .get_modes(). BR, Jani. > drm_mode_probed_add(connector, mode); > ret = 1; > } -- Jani Nikula, Intel

Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration

2024-06-18 Thread Jani Nikula
lue of this member? If you don't document it, people will find creative uses for this. BR, Jani. > + bool async_flip; > }; > > #define obj_to_plane(x) container_of(x, struct drm_plane, base) -- Jani Nikula, Intel

Re: [PATCH v1 1/1] treewide: Align match_string() with sysfs_match_string()

2024-06-04 Thread Jani Nikula
ing() isn't a great argument alone, because this adds three times the number of __match_string() calls than there are __sysfs_match_string() calls. It's not a good model to follow. Arguably both should be renamed. BR, Jani. -- Jani Nikula, Intel

Re: [PATCH 4/4] drm: enable -Wformat-truncation across the subsystem

2024-05-24 Thread Jani Nikula
On Thu, 23 May 2024, Sam Ravnborg wrote: > Hi Jani, > > On Thu, May 23, 2024 at 06:51:09PM +0300, Jani Nikula wrote: >> With the -Wformat-truncation warnings fixed, finish the job started in >> commit a61ddb4393ad ("drm: enable (most) W=1 warnings by default across >

Re: [PATCH 1/4] drm/amdgpu: fix -Wformat-truncation warning in amdgpu_gfx_kiq_init_ring()

2024-05-24 Thread Jani Nikula
On Thu, 23 May 2024, Alex Deucher wrote: > Already fixed with this patch: > https://patchwork.freedesktop.org/patch/594864/ Great, thanks! BR, Jani. -- Jani Nikula, Intel

Re: [PATCH 3/4] drm/imx: fix -Wformat-truncation warning in imx_ldb_probe()

2024-05-24 Thread Jani Nikula
On Thu, 23 May 2024, Ville Syrjälä wrote: > On Thu, May 23, 2024 at 06:51:08PM +0300, Jani Nikula wrote: >> Enabling -Wformat-truncation yields the following warning: >> >> ../drivers/gpu/drm/imx/ipuv3/imx-ldb.c: In function ‘imx_ldb_probe’: >> ../drivers/gpu/drm

[PATCH 4/4] drm: enable -Wformat-truncation across the subsystem

2024-05-23 Thread Jani Nikula
With the -Wformat-truncation warnings fixed, finish the job started in commit a61ddb4393ad ("drm: enable (most) W=1 warnings by default across the subsystem"), and enable that warning too. Signed-off-by: Jani Nikula --- Gut feeling says there are more issues, and my configs just d

[PATCH 3/4] drm/imx: fix -Wformat-truncation warning in imx_ldb_probe()

2024-05-23 Thread Jani Nikula
e 16 658 | snprintf(clkname, sizeof(clkname), "di%d_sel", i); | ^ Silence the warning by checking the snprintf() return value. Signed-off-by: Jani Nikula --- Cc: Philipp Zabel Cc: Shawn Guo Cc: Sascha Ha

[PATCH 2/4] drm/nouveau: fix -Wformat-truncation warning in nouveau_backlight_init()

2024-05-23 Thread Jani Nikula
"nv_backlight%d", nb); | ^~~~ Silence the warning by checking the snprintf() return value. Signed-off-by: Jani Nikula --- Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: dri-de...@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org --- drivers/gpu/drm/n

[PATCH 1/4] drm/amdgpu: fix -Wformat-truncation warning in amdgpu_gfx_kiq_init_ring()

2024-05-23 Thread Jani Nikula
Silence the warning by checking the snprintf() return value. Signed-off-by: Jani Nikula --- Cc: Alex Deucher Cc: "Christian König" Cc: Pan Xinhui Cc: amd-...@lists.freedesktop.org Cc: dri-de...@lists.freedesktop.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.

[PATCH 0/4] drm: enable -Wformat-truncation

2024-05-23 Thread Jani Nikula
Jani Nikula (4): drm/amdgpu: fix -Wformat-truncation warning in amdgpu_gfx_kiq_init_ring() drm/nouveau: fix -Wformat-truncation warning in nouveau_backlight_init() drm/imx: fix -Wformat-truncation warning in imx_ldb_probe() drm: enable -Wformat-truncation across the subsystem

Re: [RESEND 0/6] drm, nouveau/radeon/amdpgu: edid_blob_ptr cleanups

2024-05-23 Thread Jani Nikula
On Mon, 13 May 2024, Alex Deucher wrote: > On Mon, May 13, 2024 at 8:20 AM Jani Nikula wrote: >> >> On Fri, 10 May 2024, Alex Deucher wrote: >> > On Fri, May 10, 2024 at 11:17 AM Jani Nikula wrote: >> > Series is: >> > Acked-by: Alex Deucher >>

Re: [RESEND 0/6] drm, nouveau/radeon/amdpgu: edid_blob_ptr cleanups

2024-05-13 Thread Jani Nikula
On Fri, 10 May 2024, Alex Deucher wrote: > On Fri, May 10, 2024 at 11:17 AM Jani Nikula wrote: >> >> I've sent this some moths ago, let's try again... >> >> BR, >> Jani. >> >> Jani Nikula (6): >> drm/nouveau: convert to using is_hdmi and h

Re: [RESEND 1/6] drm/nouveau: convert to using is_hdmi and has_audio from display info

2024-05-13 Thread Jani Nikula
On Fri, 10 May 2024, Lyude Paul wrote: > Reviewed-by: Lyude Paul Thanks, how do you want to handle merging this? BR, Jani. > > On Fri, 2024-05-10 at 18:08 +0300, Jani Nikula wrote: >> Prefer the parsed results for is_hdmi and has_audio in display info >

[RESEND 6/6] drm/connector: update edid_blob_ptr documentation

2024-05-10 Thread Jani Nikula
Accessing the EDID via edid_blob_ptr causes chicken-and-egg problems. Keep edid_blob_ptr as the userspace interface that should be accessed via dedicated functions. Signed-off-by: Jani Nikula --- include/drm/drm_connector.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[RESEND 5/6] drm/edid: add a helper for EDID sysfs property show

2024-05-10 Thread Jani Nikula
Add a helper to get the EDID property for sysfs property show. This hides all the edid_blob_ptr usage within drm_edid.c. Signed-off-by: Jani Nikula --- drivers/gpu/drm/drm_crtc_internal.h | 2 ++ drivers/gpu/drm/drm_edid.c | 33 + drivers/gpu/drm

[RESEND 4/6] drm/amdgpu: remove amdgpu_connector_edid() and stop using edid_blob_ptr

2024-05-10 Thread Jani Nikula
ing it. Cc: Alex Deucher Cc: Christian König Cc: Pan, Xinhui Cc: amd-...@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 16 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.h | 1 - drivers/gpu/drm/amd/amdgpu/dce_v10_

[RESEND 3/6] drm/radeon: remove radeon_connector_edid() and stop using edid_blob_ptr

2024-05-10 Thread Jani Nikula
ing it. Cc: Alex Deucher Cc: Christian König Cc: Pan, Xinhui Cc: amd-...@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/radeon/radeon_audio.c | 7 --- drivers/gpu/drm/radeon/radeon_connectors.c | 15 --- drivers/gpu/drm/radeon/radeon_mode.h |

[RESEND 2/6] drm/radeon: convert to using is_hdmi and has_audio from display info

2024-05-10 Thread Jani Nikula
Prefer the parsed results for is_hdmi and has_audio in display info over calling drm_detect_hdmi_monitor() and drm_detect_monitor_audio(), respectively. Cc: Alex Deucher Cc: Christian König Cc: Pan, Xinhui Cc: amd-...@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm

[RESEND 1/6] drm/nouveau: convert to using is_hdmi and has_audio from display info

2024-05-10 Thread Jani Nikula
Cc: Danilo Krummrich Cc: nouveau@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 drivers/gpu/drm/nouveau/dispnv50/head.c | 8 +--- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 3 files changed, 6 insertions(+), 12

[RESEND 0/6] drm, nouveau/radeon/amdpgu: edid_blob_ptr cleanups

2024-05-10 Thread Jani Nikula
I've sent this some moths ago, let's try again... BR, Jani. Jani Nikula (6): drm/nouveau: convert to using is_hdmi and has_audio from display info drm/radeon: convert to using is_hdmi and has_audio from display info drm/radeon: remove radeon_connector_edid() and stop using

Re: [PATCH v2 03/12] drm/i915: Make I2C terminology more inclusive

2024-05-06 Thread Jani Nikula
; main drivers/i2c accepting the new terminology. So we don't have a >> > risk of that getting push back and new names there and we having >> > to rename it once again. >> >> Just to be explicit, did you want me to remove the Acked-by in v3, or will >> yo

Re: [PATCH 1/2] drm/print: drop include debugfs.h and include where needed

2024-04-24 Thread Jani Nikula
On Mon, 22 Apr 2024, Jani Nikula wrote: > Surprisingly many places depend on debugfs.h to be included via > drm_print.h. Fix them. > > v3: Also fix armada, ite-it6505, imagination, msm, sti, vc4, and xe > > v2: Also fix ivpu and vmwgfx > > Reviewed-by: Andrzej Hajda &

Re: [PATCH v2 1/2] drm/print: drop include debugfs.h and include where needed

2024-04-22 Thread Jani Nikula
On Thu, 18 Apr 2024, Jani Nikula wrote: > On Thu, 18 Apr 2024, Robert Foss wrote: >> I'm seeing build errors for drivers/gpu/drm/bridge/ite-it6505.c, is >> this expected? > > No, but it's possible my configs didn't catch all configs. :( Okay, enabled a bunch more arm/arm6

[PATCH 1/2] drm/print: drop include debugfs.h and include where needed

2024-04-22 Thread Jani Nikula
/20240410141434.157908-1-jani.nik...@intel.com Signed-off-by: Jani Nikula --- Cc: Jacek Lawrynowicz Cc: Stanislaw Gruszka Cc: Oded Gabbay Cc: Russell King Cc: David Airlie Cc: Daniel Vetter Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej

Re: [PATCH v2 1/2] drm/print: drop include debugfs.h and include where needed

2024-04-18 Thread Jani Nikula
On Thu, 18 Apr 2024, Robert Foss wrote: > I'm seeing build errors for drivers/gpu/drm/bridge/ite-it6505.c, is > this expected? No, but it's possible my configs didn't catch all configs. :( BR, Jani. -- Jani Nikula, Intel

[PATCH v2 1/2] drm/print: drop include debugfs.h and include where needed

2024-04-18 Thread Jani Nikula
Surprisingly many places depend on debugfs.h to be included via drm_print.h. Fix them. v2: Also fix ivpu and vmwgfx Reviewed-by: Andrzej Hajda Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20240410141434.157908-1-jani.nik...@intel.com Signed-off-by: Jani Nikula

Re: [PATCH 1/2] drm/print: drop include debugfs.h and include where needed

2024-04-15 Thread Jani Nikula
On Wed, 10 Apr 2024, Jani Nikula wrote: > Surprisingly many places depend on debugfs.h to be included via > drm_print.h. Fix them. While all of this is trivial, merely adding some includes, please consider acking the changes to your corner of the kernel. Thanks, Jani. > > Signed-

[PATCH 1/2] drm/print: drop include debugfs.h and include where needed

2024-04-10 Thread Jani Nikula
Surprisingly many places depend on debugfs.h to be included via drm_print.h. Fix them. Signed-off-by: Jani Nikula --- Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas

Re: [PATCH v0 03/14] drm/gma500,drm/i915: Make I2C terminology more inclusive

2024-04-02 Thread Jani Nikula
On Tue, 02 Apr 2024, Easwar Hariharan wrote: > On 4/2/2024 7:32 AM, Jani Nikula wrote: >> On Tue, 02 Apr 2024, Easwar Hariharan wrote: >>> On 4/2/2024 12:48 AM, Jani Nikula wrote: >>>> On Fri, 29 Mar 2024, Easwar Hariharan wrote: >>>>> I2C v7, SM

Re: [PATCH v0 03/14] drm/gma500,drm/i915: Make I2C terminology more inclusive

2024-04-02 Thread Jani Nikula
On Tue, 02 Apr 2024, Easwar Hariharan wrote: > On 4/2/2024 12:48 AM, Jani Nikula wrote: >> On Fri, 29 Mar 2024, Easwar Hariharan wrote: >>> I2C v7, SMBus 3.2, and I3C specifications have replaced "master/slave" >>> with more appropriate terms. Inspired by and

Re: [PATCH v0 03/14] drm/gma500,drm/i915: Make I2C terminology more inclusive

2024-04-02 Thread Jani Nikula
On Fri, 29 Mar 2024, Easwar Hariharan wrote: > I2C v7, SMBus 3.2, and I3C specifications have replaced "master/slave" > with more appropriate terms. Inspired by and following on to Wolfram's > series to fix drivers/i2c/[1], fix the terminology for users of > I2C_ALGOBIT bitbanging interface, now

Re: [PATCH] nouveau/dmem: handle kcalloc() allocation failure

2024-03-05 Thread Jani Nikula
On Tue, 05 Mar 2024, duom...@zju.edu.cn wrote: > On Mon, 04 Mar 2024 14:14:52 +0200 Jani Nikula wrote: >> >> The kcalloc() in nouveau_dmem_evict_chunk() will return null if >> >> the physical memory has run out. As a result, if we dereference >> >> src_pfns,

Re: [PATCH] nouveau/dmem: handle kcalloc() allocation failure

2024-03-04 Thread Jani Nikula
in a warning due to -Wvla. See 0bb95f80a38f ("Makefile: Globally enable VLA warning"). Error checking and propagation is the way to go. BR, Jani. -- Jani Nikula, Intel

Re: [PATCH v3 1/9] backlight/corgi-lcd: Include

2024-02-26 Thread Jani Nikula
Miao >> >*/ >> > +#include >> > #include >> > #include >> > #include >> >> -- >> -- >> Thomas Zimmermann >> Graphics Driver Developer >> SUSE Software Solutions Germany GmbH >> Frankenstrasse 146, 90461 Nuernberg, Germany >> GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman >> HRB 36809 (AG Nuernberg) >> -- Jani Nikula, Intel

Re: [PATCH v6 3/5] drm: Add support to get EDID from ACPI

2024-02-15 Thread Jani Nikula
->acpi_edid_allowed) > > That should probably be called 'prefer_acpi_edid' or something > since it's the first choice when the flag is set. > > But I'm not so sure there's any real benefit in having this > flag at all. You anyway have to modify the driver to use this, > so why not just have the driver do the call directly instead of > adding this extra detour via the flag? Heh, round and round we go [1]. BR, Jani. [1] https://lore.kernel.org/r/87sf23auxv@intel.com -- Jani Nikula, Intel

Re: [PATCH v6 3/5] drm: Add support to get EDID from ACPI

2024-02-15 Thread Jani Nikula
2 @@ struct drm_connector { > > /** @hdr_sink_metadata: HDR Metadata Information read from sink */ > struct hdr_sink_metadata hdr_sink_metadata; > + > + /** > + * @acpi_edid_allowed: Get the EDID from the BIOS, if available. > + * This is only applicable to eDP and LVDS displays. > + */ > + bool acpi_edid_allowed; > }; > > #define obj_to_connector(x) container_of(x, struct drm_connector, base) > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h > index 7923bc00dc7a..1c1ee927de9c 100644 > --- a/include/drm/drm_edid.h > +++ b/include/drm/drm_edid.h > @@ -459,5 +459,6 @@ bool drm_edid_is_digital(const struct drm_edid *drm_edid); > > const u8 *drm_find_edid_extension(const struct drm_edid *drm_edid, > int ext_id, int *ext_index); > +const struct drm_edid *drm_edid_read_acpi(struct drm_connector *connector); > > #endif /* __DRM_EDID_H__ */ -- Jani Nikula, Intel

Re: [PATCH 0/7] fbdev: Clean up include dependencies in header

2024-02-12 Thread Jani Nikula
which needs backlight.h in > one of its source files. On the series, Reviewed-by: Jani Nikula > Thomas Zimmermann (7): > drm/nouveau: Include > fbdev: Do not include in header > fbdev: Do not include in header > fbdev: Do not include in header > fbdev: Do

Re: [PATCH 2/6] drm/nouveau/svm: remove unused but set variables

2024-02-01 Thread Jani Nikula
On Wed, 31 Jan 2024, Danilo Krummrich wrote: > On 1/10/24 18:39, Jani Nikula wrote: >> Fix the W=1 warning -Wunused-but-set-variable. >> >> Cc: Karol Herbst >> Cc: Lyude Paul >> Cc: Danilo Krummrich >> Cc: nouveau@lists.freedesktop.org >> Signed

Re: [PATCH 1/6] drm/nouveau/acr/ga102: remove unused but set variable

2024-02-01 Thread Jani Nikula
On Wed, 31 Jan 2024, Danilo Krummrich wrote: > On 1/10/24 18:39, Jani Nikula wrote: >> Fix the W=1 warning -Wunused-but-set-variable. >> >> Cc: Karol Herbst >> Cc: Lyude Paul >> Cc: Danilo Krummrich >> Cc: nouveau@lists.freedesktop.org >> Signed

Re: [PATCH 2/6] drm/nouveau/svm: remove unused but set variables

2024-01-31 Thread Jani Nikula
On Wed, 10 Jan 2024, Jani Nikula wrote: > Fix the W=1 warning -Wunused-but-set-variable. > > Cc: Karol Herbst > Cc: Lyude Paul > Cc: Danilo Krummrich > Cc: nouveau@lists.freedesktop.org > Signed-off-by: Jani Nikula Ping? > --- > drivers/gpu/drm/nouveau/nouveau

Re: [PATCH 1/6] drm/nouveau/acr/ga102: remove unused but set variable

2024-01-31 Thread Jani Nikula
On Wed, 10 Jan 2024, Jani Nikula wrote: > Fix the W=1 warning -Wunused-but-set-variable. > > Cc: Karol Herbst > Cc: Lyude Paul > Cc: Danilo Krummrich > Cc: nouveau@lists.freedesktop.org > Signed-off-by: Jani Nikula Ping? > --- > drivers/gpu/drm/nouveau/nvkm/sub

[PATCH v2] drm/nouveau: convert to using is_hdmi and has_audio from display info

2024-01-15 Thread Jani Nikula
Cc: Danilo Krummrich Cc: nouveau@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 drivers/gpu/drm/nouveau/dispnv50/head.c | 8 +--- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 3 files changed, 6 insertions(+), 12

Re: [PATCH 1/6] drm/nouveau: convert to using is_hdmi and has_audio from display info

2024-01-14 Thread Jani Nikula
On Sun, 14 Jan 2024, Ilia Mirkin wrote: > On Fri, Jan 12, 2024 at 11:50 AM Jani Nikula wrote: >> >> Prefer the parsed results for is_hdmi and has_audio in display info over >> calling drm_detect_hdmi_monitor() and drm_detect_monitor_audio(), >> respectively. >> &

[PATCH 1/6] drm/nouveau: convert to using is_hdmi and has_audio from display info

2024-01-12 Thread Jani Nikula
@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 drivers/gpu/drm/nouveau/dispnv50/head.c | 8 +--- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/nouveau

[PATCH 2/6] drm/nouveau/svm: remove unused but set variables

2024-01-10 Thread Jani Nikula
Fix the W=1 warning -Wunused-but-set-variable. Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouveau@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau/nouveau_svm.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers

[PATCH 1/6] drm/nouveau/acr/ga102: remove unused but set variable

2024-01-10 Thread Jani Nikula
Fix the W=1 warning -Wunused-but-set-variable. Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouveau@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH 1/3] drm/nouveau: include drm/drm_edid.h only where needed

2024-01-10 Thread Jani Nikula
On Tue, 09 Jan 2024, Danilo Krummrich wrote: > On 1/9/24 10:59, Jani Nikula wrote: >> On Mon, 08 Jan 2024, Danilo Krummrich wrote: >>> On 1/4/24 21:16, Jani Nikula wrote: >>>> Including drm_edid.h from nouveau_connector.h causes the rebuild of 15 >>>>

Re: [PATCH -next] drm/nouveau: uapi: fix kerneldoc warnings

2024-01-09 Thread Jani Nikula
; __u32 op_count; >> /** >> * @flags: the flags for a _nouveau_vm_bind ioctl >> + * >> + * Supported values: >> + * >> + * %DRM_NOUVEAU_VM_BIND_RUN_ASYNC - Indicates that the given VM_BIND >> + * operation should be executed asynchronously by the kernel. >> + * >> + * If this flag is not supplied the kernel executes the associated >> + * operations synchronously and doesn't accept any _nouveau_sync >> + * objects. >> */ >> __u32 flags; >> -/** >> - * @DRM_NOUVEAU_VM_BIND_RUN_ASYNC: >> - * >> - * Indicates that the given VM_BIND operation should be executed >> asynchronously >> - * by the kernel. >> - * >> - * If this flag is not supplied the kernel executes the associated >> operations >> - * synchronously and doesn't accept any _nouveau_sync objects. >> - */ >> #define DRM_NOUVEAU_VM_BIND_RUN_ASYNC 0x1 >> /** >> * @wait_count: the number of wait _nouveau_syncs > -- Jani Nikula, Intel

Re: [PATCH 1/3] drm/nouveau: include drm/drm_edid.h only where needed

2024-01-09 Thread Jani Nikula
On Mon, 08 Jan 2024, Danilo Krummrich wrote: > On 1/4/24 21:16, Jani Nikula wrote: >> Including drm_edid.h from nouveau_connector.h causes the rebuild of 15 >> files when drm_edid.h is modified, while there are only a few files that >> actually need to include drm_edid.h. &g

[PATCH 1/3] drm/nouveau: include drm/drm_edid.h only where needed

2024-01-04 Thread Jani Nikula
Including drm_edid.h from nouveau_connector.h causes the rebuild of 15 files when drm_edid.h is modified, while there are only a few files that actually need to include drm_edid.h. Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouveau@lists.freedesktop.org Signed-off-by: Jani Nikula

Re: [PATCH] drm/nouveau: include drm/drm_edid.h only where needed

2023-12-19 Thread Jani Nikula
On Tue, 12 Dec 2023, Jani Nikula wrote: > Including drm_edid.h from nouveau_connector.h causes the rebuild of 15 > files when drm_edid.h is modified, while there are only a few files that > actually need to include drm_edid.h. Ping? > > Signed-off-by: Jani Nikula > ---

[PATCH] drm/nouveau: include drm/drm_edid.h only where needed

2023-12-12 Thread Jani Nikula
Including drm_edid.h from nouveau_connector.h causes the rebuild of 15 files when drm_edid.h is modified, while there are only a few files that actually need to include drm_edid.h. Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau/dispnv50/head.c | 1 + drivers/gpu/drm/nouveau

Re: [Nouveau] [PATCH V2] drm/modes: Fix divide error in drm_mode_debug_printmodeline

2023-11-21 Thread Jani Nikula
t;vscan > 1) { >> +if (unlikely(check_mul_overflow(den, mode->vscan, ))) >> +return 0; >> +} > > I can't see any driver that actually supports vscan>1. Only > nouveau has some code for it, but doesn't look like it does > an

Re: [Nouveau] [PATCH drm-misc-next v7 4/7] drm/gpuvm: add an abstraction for a VM / BO combination

2023-10-31 Thread Jani Nikula
gh I think only the latter is documented and recommended. It's also the most popular: 10577 Return 3596 Returns 1104 RETURN 568 return 367 returns 352 RETURNS 1 RETURNs BR, Jani. -- Jani Nikula, Intel

Re: [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-07 Thread Jani Nikula
e. I believe that > there always some people need do back-port and upstream work > for various reasons. While that may be true, it's not an argument in favour of adding new module parameters or special values to existing module parameters. They would have to be backported just as well. BR, Jani. -- Jani

Re: [Nouveau] [RFC, drm-misc-next v4 0/9] PCI/VGA: Allowing the user to select the primary video adapter at boot time

2023-09-05 Thread Jani Nikula
vers/gpu/drm/nouveau/nouveau_vga.c | 11 +++- > drivers/gpu/drm/radeon/radeon_device.c| 10 +++- > drivers/pci/vgaarb.c | 43 -- > drivers/vfio/pci/vfio_pci_core.c | 2 +- > include/linux/vgaarb.h| 8 ++- > 14 files changed, 210 insertions(+), 19 deletions(-) -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH (set 1) 00/20] Rid W=1 warnings from GPU

2023-08-24 Thread Jani Nikula
subsystem warning free? BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-23 Thread Jani Nikula
_device *. As shown by the numbers above. If folks insist on following through with this anyway, I'm firmly in the camp the name should be "drm" and nothing else. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-23 Thread Jani Nikula
On Wed, 12 Jul 2023, Uwe Kleine-König wrote: > Hello Jani, > > On Wed, Jul 12, 2023 at 05:34:28PM +0300, Jani Nikula wrote: >> On Wed, 12 Jul 2023, Uwe Kleine-König wrote: >> > Hello, >> > >> > while I debugged an issue in the imx-lcdc driver I

Re: [Nouveau] [PATCH v7 6/8] PCI/VGA: Introduce is_boot_device function callback to vga_client_register

2023-06-30 Thread Jani Nikula
l merge all of the patches in this series (e.g. including >> > > the patch for drm/amdgpu(7/8) and drm/radeon(8/8)) ? >> > > >> > > Or just part of them? > > The bulk of this series is drivers/pci changes, so typically I would > merge all the patches after getti

Re: [Nouveau] [PATCH 1/2] drm/i915: constify pointers to hwmon_channel_info

2023-04-11 Thread Jani Nikula
ll/20230406203103.3011503-2-krzysztof.kozlow...@linaro.org/ > > Therefore I propose this should also go via hwmon tree. Thanks for doing this, I couldn't be bothered to follow through with it [1]. Acked-by: Jani Nikula [1] https://lore.kernel.org/r/20230309082841.400118-1-jani.nik...@intel.com &g

[Nouveau] [PATCH 02/12] drm/nouveau: convert to using is_hdmi and has_audio from display info

2023-03-30 Thread Jani Nikula
@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 8 drivers/gpu/drm/nouveau/dispnv50/head.c | 8 +--- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/nouveau

[Nouveau] [PATCH 00/12] drm: reduce drm_detect_monitor_audio/drm_detect_hdmi_monitor/edid_blob_ptr usage

2023-03-30 Thread Jani Nikula
Jani Nikula (12): drm/edid: parse display info has_audio similar to is_hdmi drm/nouveau: convert to using is_hdmi and has_audio from display info drm/radeon: convert to using is_hdmi and has_audio from display info drm/radeon: remove radeon_connector_edid() and stop using edid_blob_ptr

Re: [Nouveau] [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-16 Thread Jani Nikula
this. Personally I think it's enough to build test and fix any fallout afterwards. To that end, I did build test this myself with my config, and it was fine, though that probably doesn't add much coverage. FWIW, Acked-by: Jani Nikula -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] Coverity: nouveau_dp_irq(): Null pointer dereferences

2022-11-14 Thread Jani Nikula
On Fri, 11 Nov 2022, Karol Herbst wrote: > On Fri, Nov 11, 2022 at 9:16 PM Kees Cook wrote: >> >> On Fri, Nov 11, 2022 at 09:06:54PM +0100, Karol Herbst wrote: >> > On Fri, Nov 11, 2022 at 8:21 PM Kees Cook wrote: >> > > >> > > On Fri, Nov

Re: [Nouveau] Coverity: nouveau_dp_irq(): Null pointer dereferences

2022-11-11 Thread Jani Nikula
make > sure fixes get into linux-next. :) For patches fixing this, please > include these lines (but double-check the "Fixes" first): > > Reported-by: coverity-bot > Addresses-Coverity-ID: 1527266 ("Null pointer dereferences") > Fixes: a0922278f83e ("drm/nouveau/kms/nv50-: Refactor and cleanup DP HPD > handling") > > Thanks for your attention! -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v2 13/33] drm/client: Add some tests for drm_connector_pick_cmdline_mode()

2022-09-23 Thread Jani Nikula
rd "); > +MODULE_LICENSE("GPL"); I think these annotations are incompatible with including the unit test, and, in this case, affect drm.ko. And we'll have two kinds of tests, those that get built via tests/Makefile, and those that get included, like this one, which should not be mentioned in tests/Makefile. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v2 10/33] drm/modes: Add a function to generate analog display modes

2022-09-23 Thread Jani Nikula
hedding: I find "pixel_clock_hz / 1000" has much more clarity than "pixel_clock_hz / HZ_PER_KHZ". I don't consider the SI prefixes magic numbers. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v5 11/31] drm/i915: Call acpi_video_register_backlight() (v3)

2022-09-02 Thread Jani Nikula
intel_acpi_video_register() helper which checks if a panel > is present and then calls acpi_video_register_backlight() > > Signed-off-by: Hans de Goede Apologies for the delay. I truly appreciate the effort you've put into this series, and I'm looking forward to seeing the next steps in drm! Reviewed-by: Jani

[Nouveau] [PATCH 2/9] drm/nouveau: convert to using is_hdmi and has_audio from display info

2022-09-01 Thread Jani Nikula
Prefer the parsed results for is_hdmi and has_audio in display info over calling drm_detect_hdmi_monitor() and drm_detect_monitor_audio(), respectively. Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: nouveau@lists.freedesktop.org Signed-off-by: Jani Nikula --- drivers/gpu/drm/nouveau

[Nouveau] [PATCH 0/9] drm: convert to using is_hdmi and has_audio from display info

2022-09-01 Thread Jani Nikula
en Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: nouveau@lists.freedesktop.org Jani Nikula (9): drm/edid: parse display info has_audio similar to is_hdmi drm/nouveau: convert to using is_hdmi and has_audio from display info drm/radeon: convert to using is_hdmi and has_audio from display info

Re: [Nouveau] [PATCH v2 14/41] drm/modes: Move named modes parsing to a separate function

2022-08-30 Thread Jani Nikula
On Tue, 30 Aug 2022, Maxime Ripard wrote: > Hi, > > On Tue, Aug 30, 2022 at 01:43:07PM +0300, Jani Nikula wrote: >> On Tue, 30 Aug 2022, Geert Uytterhoeven wrote: >> > On Mon, Aug 29, 2022 at 3:13 PM Maxime Ripard wrote: >> >> +#define STR_STRICT_EQ(str, le

Re: [Nouveau] [PATCH v2 14/41] drm/modes: Move named modes parsing to a separate function

2022-08-30 Thread Jani Nikula
construct is also duplicated elsewhere in the series, and I kept being confused by it. The above is precisely the same as: str_has_prefix(str, cmp) == len Which is more intuitive and available in string.h instead of being a local duplicate. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v4 11/31] drm/i915: Call acpi_video_register_backlight() (v2)

2022-08-24 Thread Jani Nikula
On Wed, 24 Aug 2022, Hans de Goede wrote: > Hi, > > On 8/24/22 14:47, Jani Nikula wrote: >> On Wed, 24 Aug 2022, Hans de Goede wrote: >>> On machins without an i915 opregion the acpi_video driver immediately >>> probes the ACPI video bus and used to also im

Re: [Nouveau] [PATCH v4 02/31] drm/i915: Don't register backlight when another backlight should be used

2022-08-24 Thread Jani Nikula
-952,6 +954,11 @@ int intel_backlight_device_register(struct > intel_connector *connector) > > WARN_ON(panel->backlight.max == 0); > > + if (!acpi_video_backlight_use_native()) { > + DRM_INFO("Skipping intel_backlight regist

Re: [Nouveau] [PATCH v4 11/31] drm/i915: Call acpi_video_register_backlight() (v2)

2022-08-24 Thread Jani Nikula
t; > drm_dbg_kms(connector->base.dev, > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > index 69ce6db6a7c1..14b0dcaf25c2 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -756,6 +756,8 @@ struct drm_i915_private { > > bool ipc_enabled; > > + bool have_panel; > + > struct intel_audio_private audio; > > struct i915_pmu pmu; -- Jani Nikula, Intel Open Source Graphics Center

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

2022-06-29 Thread Jani Nikula
through this in detail and thought. I've glanced over it on a few occasions, and I don't have anything against it really. Acked-by: Jani Nikula Before merging, please ensure you've sent the entire series Cc'd intel-gfx, and got a green light from CI. > > Cc: Wayne Lin > Cc: Ville S

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

2022-06-29 Thread Jani Nikula
ies from the previous topology state > > Signed-off-by: Lyude Paul > Cc: Wayne Lin > Cc: Ville Syrjälä > Cc: Fangzhi Zuo > Cc: Jani Nikula > Cc: Imre Deak > Cc: Daniel Vetter > Cc: Sean Paul > --- > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +- >

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

2022-06-29 Thread Jani Nikula
c: Wayne Lin > Cc: Ville Syrjälä > Cc: Fangzhi Zuo > Cc: Jani Nikula > Cc: Imre Deak > Cc: Daniel Vetter > Cc: Sean Paul > --- > drivers/gpu/drm/display/drm_dp_mst_topology.c | 109 -- > 1 file changed, 45 insertions(+), 64 deletions(-) > > diff --

[Nouveau] [PATCH v1 00/13] drm/edid: expand on struct drm_edid usage

2022-05-24 Thread Jani Nikula
rol Herbst Cc: Laurent Pinchart Cc: Lyude Paul Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Neil Armstrong Cc: Robert Foss Cc: Thomas Zimmermann Cc: Ville Syrjälä Cc: Xinhui Pan Cc: amd-...@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Jani Nikula (13): drm/edid: add block coun

Re: [Nouveau] [PATCH 01/14] ACPI: video: Add a native function parameter to acpi_video_get_backlight_type()

2022-05-19 Thread Jani Nikula
On Wed, 18 May 2022, Hans de Goede wrote: > Hi, > > On 5/18/22 10:55, Jani Nikula wrote: >> On Tue, 17 May 2022, Hans de Goede wrote: >>> ATM on x86 laptops where we want userspace to use the acpi_video backlight >>> device we often register both

Re: [Nouveau] [PATCH 00/14] drm/kms: Stop registering multiple /sys/class/backlight devs for a single display

2022-05-18 Thread Jani Nikula
On Wed, 18 May 2022, Hans de Goede wrote: > Hi, > > On 5/18/22 10:44, Jani Nikula wrote: >> On Tue, 17 May 2022, Hans de Goede wrote: >>> Hi All, >>> >>> As mentioned in my RFC titled "drm/kms: control display brightness through >>> dr

Re: [Nouveau] [PATCH 01/14] ACPI: video: Add a native function parameter to acpi_video_get_backlight_type()

2022-05-18 Thread Jani Nikula
n it is false. > */ Frankly, I think the boolean native parameter here, and at the call sites, is confusing, and the slightly different explanations in the commit message and comment here aren't helping. I suggest adding a separate function that the native backlight drivers should use. I think it's more obvious all around, and easier to document too. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH 00/14] drm/kms: Stop registering multiple /sys/class/backlight devs for a single display

2022-05-18 Thread Jani Nikula
ivers/platform/x86/intel/oaktrail.c | 2 +- > drivers/platform/x86/msi-laptop.c | 2 +- > drivers/platform/x86/msi-wmi.c| 2 +- > drivers/platform/x86/samsung-laptop.c | 2 +- > drivers/platform/x86/sony-laptop.c| 2 +- > drivers/platform/x86/thinkpad_acpi.c | 4 +- > drivers/platform/x86/toshiba_acpi.c | 2 +- > include/acpi/video.h | 8 ++- > 28 files changed, 156 insertions(+), 84 deletions(-) -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v2 09/11] drm: Convert open-coded yes/no strings to yesno()

2022-01-26 Thread Jani Nikula
264 100029 186bd dp/drm_dp_helper.ko.old > 981291636 264 100029 186bd dp/drm_dp_helper.ko > 1973432 1096402352 2085424 1fd230 nouveau/nouveau.ko.old > 1973432 1096402352 2085424 1fd230 nouveau/nouveau.ko > > Signed-off-by: Lucas De Marchi Reviewed-by: Ja

Re: [Nouveau] [PATCH v2 08/11] drm/gem: Sort includes alphabetically

2022-01-26 Thread Jani Nikula
On Wed, 26 Jan 2022, Lucas De Marchi wrote: > Sort includes alphabetically so it's easier to add/remove includes and > know when that is needed. > > Signed-off-by: Lucas De Marchi Reviewed-by: Jani Nikula > --- > drivers/gpu/drm/drm_gem.c | 20 ++-- >

Re: [Nouveau] [PATCH v2 02/11] drm/i915: Fix trailing semicolon

2022-01-26 Thread Jani Nikula
gt; +#define PRINT_FLAG(name) drm_printf(p, "%s: %s\n", #name, > yesno(info->display.name)); > > Signed-off-by: Lucas De Marchi Reviewed-by: Jani Nikula > --- > drivers/gpu/drm/i915/intel_device_info.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [Nouveau] [PATCH 0/3] lib/string_helpers: Add a few string helpers

2022-01-20 Thread Jani Nikula
On Thu, 20 Jan 2022, Petr Mladek wrote: > On Wed 2022-01-19 16:16:12, Jani Nikula wrote: >> On Wed, 19 Jan 2022, Petr Mladek wrote: >> > On Tue 2022-01-18 23:24:47, Lucas De Marchi wrote: >> >> d. This doesn't bring onoff() helper as there are some places in

Re: [Nouveau] [PATCH 0/3] lib/string_helpers: Add a few string helpers

2022-01-19 Thread Jani Nikula
henko: if this is accepted, my >> proposal is to take first 2 patches either through mm tree or maybe >> vsprintf. Last patch can be taken later through drm. > > I agree with Andy that it should go via drm tree. It would make it > easier to handle potential conflicts. > > Just in case, you decide to go with str_yes_no() or something similar. > Mass changes are typically done at the end on the merge window. > The best solution is when it can be done by a script. > > Best Regards, > Petr -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH 0/3] lib/string_helpers: Add a few string helpers

2022-01-19 Thread Jani Nikula
since this is "closer to home". > > I hope this is a good summary of the previous attempts and a way we can > move forward. Thanks for picking this up again. I agree with the approach here. Acked-by: Jani Nikula > > Andrew Morton, Petr Mladek, Andy Shevchenko: if this is ac

Re: [Nouveau] [PATCH v2 3/5] drm/dp: Move DisplayPort helpers into separate helper module

2021-12-15 Thread Jani Nikula
now and list all the drm subdirectories when looking up stuff that's part of drm but not drivers. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH 0/3] drm/dp: Move DisplayPort helpers into own module

2021-12-15 Thread Jani Nikula
On Mon, 13 Dec 2021, Thomas Zimmermann wrote: > Hi > > Am 13.12.21 um 14:34 schrieb Jani Nikula: >> On Mon, 13 Dec 2021, Thomas Zimmermann wrote: >>> Split-off DisplayPort functions from KMS helper library and move them >>> into their own module. Reduces the

Re: [Nouveau] [PATCH 0/3] drm/dp: Move DisplayPort helpers into own module

2021-12-13 Thread Jani Nikula
1d9ceefcddef0be33561b1646a1cbe > prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d > prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24 > -- > 2.34.1 > -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [Intel-gfx] [PATCH 2/3] drm/dp: Move DP declarations into separate header file

2021-12-13 Thread Jani Nikula
ers/gpu/drm/drm_dp_mst_topology.c > @@ -45,7 +45,7 @@ > #include > #include > > -#include "drm_crtc_helper_internal.h" > +#include "drm_dp_helper_internal.h" > #include "drm_dp_mst_topology_internal.h" > > /** > diff --git a/drivers/gpu/drm/drm_kms_helper_common.c > b/drivers/gpu/drm/drm_kms_helper_common.c > index 47e92400548d..88260d26409c 100644 > --- a/drivers/gpu/drm/drm_kms_helper_common.c > +++ b/drivers/gpu/drm/drm_kms_helper_common.c > @@ -29,6 +29,7 @@ > > #include > > +#include "drm_dp_helper_internal.h" > #include "drm_crtc_helper_internal.h" > > MODULE_AUTHOR("David Airlie, Jesse Barnes"); -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v2 1/2] drm: Add a drm_drv_enabled() to check if drivers should be enabled

2021-11-05 Thread Jani Nikula
On Fri, 05 Nov 2021, Javier Martinez Canillas wrote: > Hello Thomas, > > On 11/5/21 09:43, Thomas Zimmermann wrote: >> Hi >> >> Am 04.11.21 um 21:09 schrieb Javier Martinez Canillas: >>> Hello Jani, >>> >>> On 11/4/21 20:57, Jani Nikula wro

Re: [Nouveau] [PATCH v2 2/2] drm: Move nomodeset kernel parameter to the DRM subsystem

2021-11-05 Thread Jani Nikula
static bool vga_hardscroll_enabled; >> static bool vga_hardscroll_user_enable = true; >> >> -bool vgacon_text_force(void) >> -{ >> -return vgacon_text_mode_force; >> -} >> -EXPORT_SYMBOL(vgacon_text_force); >> - >> -static int __init text_mode(char *str) >> -{ >> -vgacon_text_mode_force = true; >> - >> -pr_warn("You have booted with nomodeset. This means your GPU drivers >> are DISABLED\n"); >> -pr_warn("Any video related functionality will be severely degraded, and >> you may not even be able to suspend the system properly\n"); >> -pr_warn("Unless you actually understand what nomodeset does, you should >> reboot without enabling it\n"); >> - >> -return 1; >> -} >> - >> -/* force text mode - used by kernel modesetting */ >> -__setup("nomodeset", text_mode); >> - >> static int __init no_scroll(char *str) >> { >> /* >> diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h >> index 48b7de80daf5..18982d3507e4 100644 >> --- a/include/drm/drm_mode_config.h >> +++ b/include/drm/drm_mode_config.h >> @@ -969,4 +969,10 @@ static inline int drm_mode_config_init(struct >> drm_device *dev) >> void drm_mode_config_reset(struct drm_device *dev); >> void drm_mode_config_cleanup(struct drm_device *dev); >> >> +#ifdef CONFIG_VGA_CONSOLE >> +extern int drm_check_modeset(void); >> +#else >> +static inline int drm_check_modeset(void) { return 0; } >> +#endif >> + >> #endif >> diff --git a/include/linux/console.h b/include/linux/console.h >> index 20874db50bc8..d4dd8384898b 100644 >> --- a/include/linux/console.h >> +++ b/include/linux/console.h >> @@ -217,12 +217,6 @@ extern atomic_t ignore_console_lock_warning; >> #define VESA_HSYNC_SUSPEND 2 >> #define VESA_POWERDOWN 3 >> >> -#ifdef CONFIG_VGA_CONSOLE >> -extern bool vgacon_text_force(void); >> -#else >> -static inline bool vgacon_text_force(void) { return false; } >> -#endif >> - >> extern void console_init(void); >> >> /* For deferred console takeover */ >> -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v2 1/2] drm: Add a drm_drv_enabled() to check if drivers should be enabled

2021-11-04 Thread Jani Nikula
bled\n", driver->name); > + return -ENODEV; > + } > + > + return 0; > +} > +EXPORT_SYMBOL(drm_drv_enabled); The name implies a bool return, but it's not. if (drm_drv_enabled(...)) { /* surprise, it's disabled! */ } BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v2 1/2] drm: Add a drm_drv_enabled() to check if drivers should be enabled

2021-11-04 Thread Jani Nikula
l clash. > > Just add a > const drm_driver * i915_drm_driver(void) > { > return > } > > And then use this function to access the drm_driver variable. Agreed on the general principle of exposing interfaces over data. But... why? I'm still at a loss what problem this solves. We pass to exactly one place, devm_drm_dev_alloc(), and it's neatly hidden away. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center

Re: [Nouveau] [PATCH v2 1/2] drm: Add a drm_drv_enabled() to check if drivers should be enabled

2021-11-04 Thread Jani Nikula
i915_modparams.modeset == -1) >> +ret = drm_drv_enabled(); > > You pass the local driver variable here - which looks wrong as this is > not the same as the driver variable declared in another file. Indeed. > Maybe move the check to new function you can add to init_funcs, > and locate the new function in i915_drv - so it has access to driver? We don't really want that, though. This check is pretty much as early as it can be, and there's a ton of useless initialization that would happen if we waited until drm_driver is available. >From my POV, drm_drv_enabled() is a solution that creates a worse problem for us than it solves. BR, Jani. > > > Sam -- Jani Nikula, Intel Open Source Graphics Center

  1   2   >