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

2023-07-13 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: [Spice-devel] [PATCH RFC v1 00/52] drm/crtc: Rename struct drm_crtc::dev to drm_dev

2023-07-12 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: [Spice-devel] [PATCH v3 07/38] drm: handle HAS_IOPORT dependencies

2023-03-15 Thread Jani Nikula
732c5ac 100644 > --- a/drivers/gpu/drm/tiny/cirrus.c > +++ b/drivers/gpu/drm/tiny/cirrus.c > @@ -308,8 +308,10 @@ static int cirrus_mode_set(struct cirrus_device *cirrus, > > cirrus_set_start_address(cirrus, 0); > > +#ifdef CONFIG_HAS_IOPORT > /* Unblank (needed on S3 resume, vgabios doesn't do it then) */ > outb(0x20, 0x3c0); > +#endif > > drm_dev_exit(idx); > return 0; -- Jani Nikula, Intel Open Source Graphics Center

Re: [Spice-devel] [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: [Spice-devel] [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: [Spice-devel] [PATCH v2 1/2] drm: Add a drm_drv_enabled() to check if drivers should be enabled

2021-11-05 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: [Spice-devel] [PATCH v2 1/2] drm: Add a drm_drv_enabled() to check if drivers should be enabled

2021-11-05 Thread Jani Nikula
gt; int ret; > > - if (vgacon_text_force() && virtio_gpu_modeset == -1) > - return -EINVAL; > + ret = drm_drv_enabled(); > + if (ret && virtio_gpu_modeset == -1) > + return ret; > > if (virtio_gpu_modeset == 0) > return -EINVAL; > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > index ab9a1750e1df..05e9949293d5 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c > @@ -1651,8 +1651,9 @@ static int __init vmwgfx_init(void) > { > int ret; > > - if (vgacon_text_force()) > - return -EINVAL; > + ret = drm_drv_enabled(); > + if (ret) > + return ret; > > ret = pci_register_driver(_pci_driver); > if (ret) > diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h > index 0cd95953cdf5..77abfc7e078b 100644 > --- a/include/drm/drm_drv.h > +++ b/include/drm/drm_drv.h > @@ -598,5 +598,6 @@ static inline bool drm_drv_uses_atomic_modeset(struct > drm_device *dev) > > int drm_dev_set_unique(struct drm_device *dev, const char *name); > > +int drm_drv_enabled(const struct drm_driver *driver); > > #endif -- Jani Nikula, Intel Open Source Graphics Center

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

2021-11-05 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

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

2021-11-05 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: [Spice-devel] [RESEND PATCH 2/5] drm: Move nomodeset kernel parameter handler to the DRM subsystem

2021-11-04 Thread Jani Nikula
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 bool vgacon_text_force(void); > +#else > +static inline bool vgacon_text_force(void) { return false; } > +#endif > + As said, maybe the CONFIG_VGA_CONSOLE ifdef should be dropped. Also, this seems like a completely arbitrary choice of header to place this. BR, Jani. > #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: [Spice-devel] [PATCH v2 09/20] drm/i915: Remove references to struct drm_device.pdev

2020-12-10 Thread Jani Nikula
On Tue, 08 Dec 2020, Thomas Zimmermann wrote: > ping for a review of the i915 patches What did you have in mind regarding merging the series? Should we just pick the patches up? BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center ___ Sp

Re: [Spice-devel] [PATCH][next] drm: Replace zero-length array with flexible-array member

2020-02-26 Thread Jani Nikula
drm/drm_displayid.h | 2 +- > include/uapi/drm/i915_drm.h | 4 ++-- Not sure it's worth touching uapi headers. They're full of both [0] and []. Again, please at least split it to a separate patch to be decided separately. BR, Jani. -- Jani Nikula, Intel Op

Re: [Spice-devel] [PATCH] drm: Split out drm_probe_helper.h

2019-01-15 Thread Jani Nikula
; expect. > > v3: Rebase on top of atomic bochs. > > Cc: Sam Ravnborg > Cc: Jani Nikula > Cc: Laurent Pinchart > Acked-by: Rodrigo Vivi (v2) > Acked-by: Benjamin Gaignard (v2) > Signed-off-by: Daniel Vetter > Cc: linux-arm-ker...@lists.infradead.org > Cc: virt