[PATCH] drm/i915: Kconfig option to disable the legacy fbdev support

Daniel Vetter daniel at ffwll.ch
Fri Oct 11 23:37:54 CEST 2013


On Fri, Oct 11, 2013 at 01:53:36PM +0800, Lee, Chon Ming wrote:
> On 10/09 09:18, Daniel Vetter wrote:
> > Boots Just Fine (tm)!
> > 
> > The only glitch seems to be that at least on Fedora the boot splash
> > gets confused and doesn't display much at all.
> > 
> > And since there's no ugly console flickering anymore in between, the
> > flicker while switching between X servers (VT support is still enabled)
> > is even more jarring.
> > 
> > Also, I'm unsure whether we don't need to somehow kick out vgacon, now
> > that nothing else gets in the way. But stuff seems to work, so I
> > don't care. Also everything still works as well with VGA_CONSOLE=n
> > 
> > Also the #ifdef mess needs a bit of a cleanup, follow-up patches will
> > do just that.
> > 
> > To keep the Kconfig tidy, extract all the i915 options into its own
> > file.
> > 
> > v2:
> > - Rebase on top of the preliminary hw support option and the
> >   intel_drv.h cleanup.
> > - Shut up warnings in i915_debugfs.c
> > 
> > v3: Use the right CONFIG variable, spotted by Chon Ming.
> > 
> > Cc: Lee, Chon Ming <chon.ming.lee at intel.com>
> > Cc: David Herrmann <dh.herrmann at gmail.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > ---
> 
> Look good to me this series.
> 
> Reviewed-by: Chon Ming Lee <chon.ming.lee at intel.com>

Thanks for the review, all patches merged to dinq.
-Daniel

> 
> >  drivers/gpu/drm/Kconfig              | 60 +-------------------------------
> >  drivers/gpu/drm/i915/Kconfig         | 67 ++++++++++++++++++++++++++++++++++++
> >  drivers/gpu/drm/i915/Makefile        |  3 +-
> >  drivers/gpu/drm/i915/i915_debugfs.c  |  9 ++---
> >  drivers/gpu/drm/i915/i915_dma.c      |  6 ++++
> >  drivers/gpu/drm/i915/i915_drv.h      |  2 ++
> >  drivers/gpu/drm/i915/intel_display.c | 10 ++++++
> >  drivers/gpu/drm/i915/intel_drv.h     | 36 +++++++++++++++----
> >  8 files changed, 122 insertions(+), 71 deletions(-)
> >  create mode 100644 drivers/gpu/drm/i915/Kconfig
> > 
> > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> > index 3104b6d..b4e4fc0 100644
> > --- a/drivers/gpu/drm/Kconfig
> > +++ b/drivers/gpu/drm/Kconfig
> > @@ -128,65 +128,7 @@ config DRM_I810
> >  	  selected, the module will be called i810.  AGP support is required
> >  	  for this driver to work.
> >  
> > -config DRM_I915
> > -	tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics"
> > -	depends on DRM
> > -	depends on AGP
> > -	depends on AGP_INTEL
> > -	# we need shmfs for the swappable backing store, and in particular
> > -	# the shmem_readpage() which depends upon tmpfs
> > -	select SHMEM
> > -	select TMPFS
> > -	select DRM_KMS_HELPER
> > -	select DRM_KMS_FB_HELPER
> > -	select FB_CFB_FILLRECT
> > -	select FB_CFB_COPYAREA
> > -	select FB_CFB_IMAGEBLIT
> > -	# i915 depends on ACPI_VIDEO when ACPI is enabled
> > -	# but for select to work, need to select ACPI_VIDEO's dependencies, ick
> > -	select BACKLIGHT_LCD_SUPPORT if ACPI
> > -	select BACKLIGHT_CLASS_DEVICE if ACPI
> > -	select VIDEO_OUTPUT_CONTROL if ACPI
> > -	select INPUT if ACPI
> > -	select THERMAL if ACPI
> > -	select ACPI_VIDEO if ACPI
> > -	select ACPI_BUTTON if ACPI
> > -	help
> > -	  Choose this option if you have a system that has "Intel Graphics
> > -	  Media Accelerator" or "HD Graphics" integrated graphics,
> > -	  including 830M, 845G, 852GM, 855GM, 865G, 915G, 945G, 965G,
> > -	  G35, G41, G43, G45 chipsets and Celeron, Pentium, Core i3,
> > -	  Core i5, Core i7 as well as Atom CPUs with integrated graphics.
> > -	  If M is selected, the module will be called i915.  AGP support
> > -	  is required for this driver to work. This driver is used by
> > -	  the Intel driver in X.org 6.8 and XFree86 4.4 and above. It
> > -	  replaces the older i830 module that supported a subset of the
> > -	  hardware in older X.org releases.
> > -
> > -	  Note that the older i810/i815 chipsets require the use of the
> > -	  i810 driver instead, and the Atom z5xx series has an entirely
> > -	  different implementation.
> > -
> > -config DRM_I915_KMS
> > -	bool "Enable modesetting on intel by default"
> > -	depends on DRM_I915
> > -	help
> > -	  Choose this option if you want kernel modesetting enabled by default,
> > -	  and you have a new enough userspace to support this. Running old
> > -	  userspaces with this enabled will cause pain.  Note that this causes
> > -	  the driver to bind to PCI devices, which precludes loading things
> > -	  like intelfb.
> > -
> > -config DRM_I915_PRELIMINARY_HW_SUPPORT
> > -	bool "Enable preliminary support for prerelease Intel hardware by default"
> > -	depends on DRM_I915
> > -	help
> > -	  Choose this option if you have prerelease Intel hardware and want the
> > -	  i915 driver to support it by default.  You can enable such support at
> > -	  runtime with the module option i915.preliminary_hw_support=1; this
> > -	  option changes the default for that module option.
> > -
> > -	  If in doubt, say "N".
> > +source "drivers/gpu/drm/i915/Kconfig"
> >  
> >  config DRM_MGA
> >  	tristate "Matrox g200/g400"
> > diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> > new file mode 100644
> > index 0000000..6199d0b
> > --- /dev/null
> > +++ b/drivers/gpu/drm/i915/Kconfig
> > @@ -0,0 +1,67 @@
> > +config DRM_I915
> > +	tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics"
> > +	depends on DRM
> > +	depends on AGP
> > +	depends on AGP_INTEL
> > +	# we need shmfs for the swappable backing store, and in particular
> > +	# the shmem_readpage() which depends upon tmpfs
> > +	select SHMEM
> > +	select TMPFS
> > +	select DRM_KMS_HELPER
> > +	# i915 depends on ACPI_VIDEO when ACPI is enabled
> > +	# but for select to work, need to select ACPI_VIDEO's dependencies, ick
> > +	select BACKLIGHT_LCD_SUPPORT if ACPI
> > +	select BACKLIGHT_CLASS_DEVICE if ACPI
> > +	select VIDEO_OUTPUT_CONTROL if ACPI
> > +	select INPUT if ACPI
> > +	select ACPI_VIDEO if ACPI
> > +	select ACPI_BUTTON if ACPI
> > +	help
> > +	  Choose this option if you have a system that has "Intel Graphics
> > +	  Media Accelerator" or "HD Graphics" integrated graphics,
> > +	  including 830M, 845G, 852GM, 855GM, 865G, 915G, 945G, 965G,
> > +	  G35, G41, G43, G45 chipsets and Celeron, Pentium, Core i3,
> > +	  Core i5, Core i7 as well as Atom CPUs with integrated graphics.
> > +	  If M is selected, the module will be called i915.  AGP support
> > +	  is required for this driver to work. This driver is used by
> > +	  the Intel driver in X.org 6.8 and XFree86 4.4 and above. It
> > +	  replaces the older i830 module that supported a subset of the
> > +	  hardware in older X.org releases.
> > +
> > +	  Note that the older i810/i815 chipsets require the use of the
> > +	  i810 driver instead, and the Atom z5xx series has an entirely
> > +	  different implementation.
> > +
> > +config DRM_I915_KMS
> > +	bool "Enable modesetting on intel by default"
> > +	depends on DRM_I915
> > +	help
> > +	  Choose this option if you want kernel modesetting enabled by default,
> > +	  and you have a new enough userspace to support this. Running old
> > +	  userspaces with this enabled will cause pain.  Note that this causes
> > +	  the driver to bind to PCI devices, which precludes loading things
> > +	  like intelfb.
> > +
> > +config DRM_I915_FBDEV
> > +	bool "Enable legacy fbdev support for the modesettting intel driver"
> > +	depends on DRM_I915
> > +	select DRM_KMS_FB_HELPER
> > +	select FB_CFB_FILLRECT
> > +	select FB_CFB_COPYAREA
> > +	select FB_CFB_IMAGEBLIT
> > +	default y
> > +	help
> > +	  Choose this option if you have a need for the legacy fbdev
> > +	  support. Note that this support also provide the linux console
> > +	  support on top of the intel modesetting driver.
> > +
> > +config DRM_I915_PRELIMINARY_HW_SUPPORT
> > +	bool "Enable preliminary support for prerelease Intel hardware by default"
> > +	depends on DRM_I915
> > +	help
> > +	  Choose this option if you have prerelease Intel hardware and want the
> > +	  i915 driver to support it by default.  You can enable such support at
> > +	  runtime with the module option i915.preliminary_hw_support=1; this
> > +	  option changes the default for that module option.
> > +
> > +	  If in doubt, say "N".
> > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> > index 65e60d2..45e14a8 100644
> > --- a/drivers/gpu/drm/i915/Makefile
> > +++ b/drivers/gpu/drm/i915/Makefile
> > @@ -33,7 +33,6 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \
> >  	  intel_panel.o \
> >  	  intel_pm.o \
> >  	  intel_i2c.o \
> > -	  intel_fb.o \
> >  	  intel_tv.o \
> >  	  intel_dvo.o \
> >  	  intel_ringbuffer.o \
> > @@ -54,6 +53,8 @@ i915-$(CONFIG_COMPAT)   += i915_ioc32.o
> >  
> >  i915-$(CONFIG_ACPI)	+= intel_acpi.o
> >  
> > +i915-$(CONFIG_DRM_I915_FBDEV) += intel_fb.o
> > +
> >  obj-$(CONFIG_DRM_I915)  += i915.o
> >  
> >  CFLAGS_i915_trace_points.o := -I$(src)
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 5fd6a5d..79bfbd5 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -1399,12 +1399,12 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
> >  {
> >  	struct drm_info_node *node = (struct drm_info_node *) m->private;
> >  	struct drm_device *dev = node->minor->dev;
> > -	drm_i915_private_t *dev_priv = dev->dev_private;
> > -	struct intel_fbdev *ifbdev;
> > +	struct intel_fbdev *ifbdev = NULL;
> >  	struct intel_framebuffer *fb;
> > -	int ret;
> >  
> > -	ret = mutex_lock_interruptible(&dev->mode_config.mutex);
> > +#ifdef CONFIG_DRM_I915_FBDEV
> > +	struct drm_i915_private *dev_priv = dev->dev_private;
> > +	int ret = mutex_lock_interruptible(&dev->mode_config.mutex);
> >  	if (ret)
> >  		return ret;
> >  
> > @@ -1420,6 +1420,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
> >  	describe_obj(m, fb->obj);
> >  	seq_putc(m, '\n');
> >  	mutex_unlock(&dev->mode_config.mutex);
> > +#endif
> >  
> >  	mutex_lock(&dev->mode_config.fb_lock);
> >  	list_for_each_entry(fb, &dev->mode_config.fb_list, base.head) {
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index f221631..90f1fb6 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1416,6 +1416,7 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
> >  	master->driver_priv = NULL;
> >  }
> >  
> > +#ifdef CONFIG_DRM_I915_FBDEV
> >  static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >  {
> >  	struct apertures_struct *ap;
> > @@ -1436,6 +1437,11 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >  
> >  	kfree(ap);
> >  }
> > +#else
> > +static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> > +{
> > +}
> > +#endif
> >  
> >  static void i915_dump_device_info(struct drm_i915_private *dev_priv)
> >  {
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index ed8653f..99f621d 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1354,8 +1354,10 @@ typedef struct drm_i915_private {
> >  
> >  	struct drm_i915_gem_object *vlv_pctx;
> >  
> > +#ifdef CONFIG_DRM_I915_FBDEV
> >  	/* list of fbdev register on this device */
> >  	struct intel_fbdev *fbdev;
> > +#endif
> >  
> >  	/*
> >  	 * The console may be contended at resume, but we don't
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index ded0d45..43e4e75 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -7318,6 +7318,7 @@ static struct drm_framebuffer *
> >  mode_fits_in_fbdev(struct drm_device *dev,
> >  		   struct drm_display_mode *mode)
> >  {
> > +#ifdef CONFIG_DRM_I915_FBDEV
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  	struct drm_i915_gem_object *obj;
> >  	struct drm_framebuffer *fb;
> > @@ -7338,6 +7339,9 @@ mode_fits_in_fbdev(struct drm_device *dev,
> >  		return NULL;
> >  
> >  	return fb;
> > +#else
> > +	return NULL;
> > +#endif
> >  }
> >  
> >  bool intel_get_load_detect_pipe(struct drm_connector *connector,
> > @@ -10084,6 +10088,12 @@ intel_user_framebuffer_create(struct drm_device *dev,
> >  	return intel_framebuffer_create(dev, mode_cmd, obj);
> >  }
> >  
> > +#ifndef CONFIG_DRM_I915_FBDEV
> > +static inline void intel_fb_output_poll_changed(struct drm_device *dev)
> > +{
> > +}
> > +#endif
> > +
> >  static const struct drm_mode_config_funcs intel_mode_funcs = {
> >  	.fb_create = intel_user_framebuffer_create,
> >  	.output_poll_changed = intel_fb_output_poll_changed,
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index adfb57c..181d10b 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -716,14 +716,36 @@ bool intel_dsi_init(struct drm_device *dev);
> >  void intel_dvo_init(struct drm_device *dev);
> >  
> >  
> > -/* intel_fb.c */
> > -int intel_fbdev_init(struct drm_device *dev);
> > -void intel_fbdev_initial_config(struct drm_device *dev);
> > -void intel_fbdev_fini(struct drm_device *dev);
> > -void intel_fbdev_set_suspend(struct drm_device *dev, int state);
> > -void intel_fb_output_poll_changed(struct drm_device *dev);
> > -void intel_fb_restore_mode(struct drm_device *dev);
> > +/* legacy fbdev emulation in intel_fb.c */
> > +#ifdef CONFIG_DRM_I915_FBDEV
> > +extern int intel_fbdev_init(struct drm_device *dev);
> > +extern void intel_fbdev_initial_config(struct drm_device *dev);
> > +extern void intel_fbdev_fini(struct drm_device *dev);
> > +extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
> > +extern void intel_fb_output_poll_changed(struct drm_device *dev);
> > +extern void intel_fb_restore_mode(struct drm_device *dev);
> > +#else
> > +static inline int intel_fbdev_init(struct drm_device *dev)
> > +{
> > +	return 0;
> > +}
> >  
> > +static inline void intel_fbdev_initial_config(struct drm_device *dev)
> > +{
> > +}
> > +
> > +static inline void intel_fbdev_fini(struct drm_device *dev)
> > +{
> > +}
> > +
> > +static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state)
> > +{
> > +}
> > +
> > +static inline void intel_fb_restore_mode(struct drm_device *dev)
> > +{
> > +}
> > +#endif
> >  
> >  /* intel_hdmi.c */
> >  void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port);
> > -- 
> > 1.8.1.4
> > 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list