fbdev no more!
Subsystems (16)
cover fbdev no more!
Hi all,
So I've taken a look again at the locking mess in our fbdev support and cried. Fixing up the console_lock mess around the fbdev notifier will be real work, semanatically the fbdev layer does lots of stupid things (like the radeon resume issue I've just debugged) and the panic notifier is pretty much a lost cause.
So I've decided to instead rip it all out. It seems to work \o/
Of course a general purpose distro propably wants David's kmscon for any fallbacks needs and a system compositor to ditch the VT subsystem - atm my machine here runs with the dummy console so that VT switching between different X sessions still works ;-)
Oh and: At least fedora's boot splash seems to be unhappy about the lack of an fbdev (it doesn't seem to do anything), which breaks early disk encryption a bit. The black screen itself shouldn't be a big issue at least for i915, since with all the fastboot work we can just hang onto the current config and framebuffer (one missing patch from Chris for the fb preservartion). So as long as the bios/grub put up something nice, it'll look ok.
So just a small step here really, but imo into the right direction. Now, please bring on the flames!
Aside: We can hide the #ifdef mess a bit better in drm/i915 I think, but I'd like to wait for a bit of feedback first. And one more: This also removes the console_lock completely from our critical path in suspend/resume!
One thing I haven't wasted a single thought about is kgdb and panic notifier support. But since the current code is pretty decently broken already (we have _tons_ of mutex grabbing and waits in there) I don't think people care that much about it anyway. Using a sprite to smash the kgdb/panic output on top of whatever's currently displaying might be an approach.
Cheers, Daniel
Daniel Vetter (3):
drm: Add separate Kconfig option for fbdev helpers drm/i915: Kconfig option to disable the legacy fbdev support drm/i915: rename intel_fb.c to intel_fbdev.c
drivers/gpu/drm/Kconfig | 57 ++----- drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/ast/Kconfig | 1 + drivers/gpu/drm/cirrus/Kconfig | 1 + drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/i915/Kconfig | 56 +++++++ drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_debugfs.c | 4 +- drivers/gpu/drm/i915/i915_dma.c | 8 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_display.c | 12 +- drivers/gpu/drm/i915/intel_drv.h | 39 ++++- drivers/gpu/drm/i915/intel_fb.c | 314 ----------------------------------- drivers/gpu/drm/i915/intel_fbdev.c | 314 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/mgag200/Kconfig | 1 + drivers/gpu/drm/nouveau/Kconfig | 1 + drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/qxl/Kconfig | 1 + drivers/gpu/drm/shmobile/Kconfig | 1 + drivers/gpu/drm/tilcdc/Kconfig | 1 + drivers/gpu/drm/udl/Kconfig | 1 + drivers/gpu/host1x/drm/Kconfig | 1 + drivers/staging/imx-drm/Kconfig | 1 + 24 files changed, 452 insertions(+), 373 deletions(-) create mode 100644 drivers/gpu/drm/i915/Kconfig delete mode 100644 drivers/gpu/drm/i915/intel_fb.c create mode 100644 drivers/gpu/drm/i915/intel_fbdev.c
Signature · 1 line
1.7.11.7
PATCH 1/3 drm: Add separate Kconfig option for fbdev helpers
For drivers which might want to disable fbdev legacy support.
Select the new option in all drivers for now, so this shouldn't result in any change. Drivers need some work anyway to make fbdev support optional (if they have it implemented, that is), so the recommended way to expose this is by adding per-driver options. At least as long as most drivers don't support disabling the fbdev support.
--- drivers/gpu/drm/Kconfig | 11 ++++++++++- drivers/gpu/drm/Makefile | 3 ++- drivers/gpu/drm/ast/Kconfig | 1 + drivers/gpu/drm/cirrus/Kconfig | 1 + drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/mgag200/Kconfig | 1 + drivers/gpu/drm/nouveau/Kconfig | 1 + drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/qxl/Kconfig | 1 + drivers/gpu/drm/shmobile/Kconfig | 1 + drivers/gpu/drm/tilcdc/Kconfig | 1 + drivers/gpu/drm/udl/Kconfig | 1 + drivers/gpu/host1x/drm/Kconfig | 1 + drivers/staging/imx-drm/Kconfig | 1 + 15 files changed, 25 insertions(+), 2 deletions(-)
drivers/gpu/drm/Kconfig +10 -1
@@ -29,11 +29,17 @@ config DRM_USB config DRM_KMS_HELPER tristate depends on DRM + help + CRTC helpers for KMS drivers. + +config DRM_KMS_FB_HELPER + bool + depends on DRM_KMS_HELPER select FB select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE help - FB and CRTC helpers for KMS drivers. + FBDEV helpers for KMS drivers. config DRM_LOAD_EDID_FIRMWARE bool "Allow to specify an EDID data set instead of probing for it"
@@ -64,6 +70,7 @@ config DRM_GEM_CMA_HELPER config DRM_KMS_CMA_HELPER bool select DRM_GEM_CMA_HELPER + select DRM_KMS_FB_HELPER select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT
@@ -96,6 +103,7 @@ config DRM_RADEON select FB_CFB_IMAGEBLIT select FW_LOADER select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_TTM select POWER_SUPPLY select HWMON
@@ -130,6 +138,7 @@ config DRM_I915 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
drivers/gpu/drm/Makefile +2 -1
@@ -21,8 +21,9 @@ drm-$(CONFIG_PCI) += ati_pcigart.o drm-usb-y := drm_usb.o -drm_kms_helper-y := drm_fb_helper.o drm_crtc_helper.o drm_dp_helper.o +drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o +drm_kms_helper-$(CONFIG_DRM_KMS_FB_HELPER) += drm_fb_helper.o drm_kms_helper-$(CONFIG_DRM_KMS_CMA_HELPER) += drm_fb_cma_helper.o obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
drivers/gpu/drm/ast/Kconfig +1 -0
@@ -6,6 +6,7 @@ config DRM_AST select FB_SYS_FILLRECT select FB_SYS_IMAGEBLIT select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_TTM help Say yes for experimental AST GPU driver. Do not enable
drivers/gpu/drm/cirrus/Kconfig +1 -0
@@ -5,6 +5,7 @@ config DRM_CIRRUS_QEMU select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_TTM help This is a KMS driver for emulated cirrus device in qemu.
drivers/gpu/drm/exynos/Kconfig +1 -0
@@ -2,6 +2,7 @@ config DRM_EXYNOS tristate "DRM Support for Samsung SoC EXYNOS Series" depends on DRM && (PLAT_SAMSUNG || ARCH_MULTIPLATFORM) select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT
drivers/gpu/drm/gma500/Kconfig +1 -0
@@ -5,6 +5,7 @@ config DRM_GMA500 select FB_CFB_FILLRECT select FB_CFB_IMAGEBLIT select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_TTM # GMA500 depends on ACPI_VIDEO when ACPI is enabled, just like i915 select ACPI_VIDEO if ACPI
drivers/gpu/drm/mgag200/Kconfig +1 -0
@@ -5,6 +5,7 @@ config DRM_MGAG200 select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_TTM help This is a KMS driver for the MGA G200 server chips, it
drivers/gpu/drm/nouveau/Kconfig +1 -0
@@ -3,6 +3,7 @@ config DRM_NOUVEAU depends on DRM && PCI select FW_LOADER select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_TTM select FB_CFB_FILLRECT select FB_CFB_COPYAREA
drivers/gpu/drm/omapdrm/Kconfig +1 -0
@@ -5,6 +5,7 @@ config DRM_OMAP depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM depends on OMAP2_DSS select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT
drivers/gpu/drm/qxl/Kconfig +1 -0
@@ -6,6 +6,7 @@ config DRM_QXL select FB_SYS_IMAGEBLIT select FB_DEFERRED_IO select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_TTM help QXL virtual GPU for Spice virtualization desktop integration. Do not enable this driver unless your distro ships a corresponding X.org QXL driver that can handle kernel modesetting.
drivers/gpu/drm/shmobile/Kconfig +1 -0
@@ -2,6 +2,7 @@ config DRM_SHMOBILE tristate "DRM Support for SH Mobile" depends on DRM && (SUPERH || ARCH_SHMOBILE) select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER help
drivers/gpu/drm/tilcdc/Kconfig +1 -0
@@ -2,6 +2,7 @@ config DRM_TILCDC tristate "DRM Support for TI LCDC Display Controller" depends on DRM && OF && ARM select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER select VIDEOMODE_HELPERS
drivers/gpu/drm/udl/Kconfig +1 -0
@@ -8,6 +8,7 @@ config DRM_UDL select FB_SYS_IMAGEBLIT select FB_DEFERRED_IO select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER help This is a KMS driver for the USB displaylink video adapters. Say M/Y to add support for these devices via drm/kms interfaces.
drivers/gpu/host1x/drm/Kconfig +1 -0
@@ -2,6 +2,7 @@ config DRM_TEGRA bool "NVIDIA Tegra DRM" depends on DRM select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select FB_SYS_FILLRECT select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT
drivers/staging/imx-drm/Kconfig +1 -0
@@ -1,6 +1,7 @@ config DRM_IMX tristate "DRM Support for Freescale i.MX" select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER select VIDEOMODE_HELPERS select DRM_GEM_CMA_HELPER select DRM_KMS_CMA_HELPER
Signature · 1 line
1.7.11.7
PATCH 2/3 drm/i915: Kconfig option to disable the legacy fbdev support
In reply to Daniel VetterBoots 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.
--- drivers/gpu/drm/Kconfig | 48 +------------------------------ drivers/gpu/drm/i915/Kconfig | 56 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++- 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 | 39 ++++++++++++++++++++----- 8 files changed, 112 insertions(+), 56 deletions(-) create mode 100644 drivers/gpu/drm/i915/Kconfig
drivers/gpu/drm/Kconfig +1 -47
@@ -128,53 +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 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. +source "drivers/gpu/drm/i915/Kconfig" config DRM_MGA tristate "Matrox g200/g400"
drivers/gpu/drm/i915/Kconfig new file +56 -0
56 lines not on this page · raw message
drivers/gpu/drm/i915/Makefile +2 -1
@@ -29,7 +29,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 \
@@ -49,6 +48,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)
drivers/gpu/drm/i915/i915_debugfs.c +3 -1
@@ -1634,10 +1634,11 @@ 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; +#ifdef CONFIG_DRM_I915_FBDEV ret =mutex_lock_interruptible (&dev->mode_config.mutex);if (ret)return ret;
@@ -1654,6 +1655,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)describe_obj (m, fb->obj);seq_printf (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) {
drivers/gpu/drm/i915/i915_dma.c +6 -0
@@ -1400,6 +1400,7 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master) master->driver_priv =NULL ; } +#ifdef CONFIG_FB static void i915_kick_out_firmware_fb (struct drm_i915_private *dev_priv) {struct apertures_struct *ap;
@@ -1420,6 +1421,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) {
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -1159,8 +1159,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
drivers/gpu/drm/i915/intel_display.c +10 -0
@@ -6649,6 +6649,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;
@@ -6669,6 +6670,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,
@@ -9167,6 +9171,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,
drivers/gpu/drm/i915/intel_drv.h +32 -7
@@ -727,10 +727,7 @@ extern int intel_framebuffer_init(struct drm_device *dev,struct intel_framebuffer *ifb, struct drm_mode_fb_cmd2 *mode_cmd, struct drm_i915_gem_object *obj); -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_prepare_page_flip (struct drm_device *dev,int plane);extern void intel_finish_page_flip (struct drm_device *dev,int pipe);extern void intel_finish_page_flip_plane (struct drm_device *dev,int plane);
@@ -743,9 +740,6 @@ extern int intel_overlay_put_image(struct drm_device *dev, void *data,extern int intel_overlay_attrs (struct drm_device *dev,void *data,struct drm_file *file_priv); -extern void intel_fb_output_poll_changed (struct drm_device *dev); -extern void intel_fb_restore_mode (struct drm_device *dev); -struct intel_shared_dpll *intel_crtc_to_shared_dpll (struct intel_crtc *crtc);
@@ -840,4 +834,35 @@ extern bool intel_set_pch_fifo_underrun_reporting(struct drm_device *dev,enum transcoder pch_transcoder, bool enable); +/* legacy fbdev emulation in intel_fbdev.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 +#endif /* __INTEL_DRV_H__ */
Signature · 1 line
1.7.11.7
PATCH 3/3 drm/i915: rename intel_fb.c to intel_fbdev.c
In reply to Daniel VetterThis file is all about the legacy fbdev support. If we want to extract framebuffer functions, we better put those into a separate file.
Also rename functions accordingly, only two have used the intel_fb_ prefix anyway.
--- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/i915_dma.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/i915/intel_drv.h | 6 +- drivers/gpu/drm/i915/intel_fb.c | 314 ----------------------------------- drivers/gpu/drm/i915/intel_fbdev.c | 314 +++++++++++++++++++++++++++++++++++ 6 files changed, 321 insertions(+), 321 deletions(-) delete mode 100644 drivers/gpu/drm/i915/intel_fb.c create mode 100644 drivers/gpu/drm/i915/intel_fbdev.c
drivers/gpu/drm/i915/Makefile +1 -1
@@ -48,7 +48,7 @@ i915-$(CONFIG_COMPAT) += i915_ioc32.o i915-$(CONFIG_ACPI) += intel_acpi.o -i915-$(CONFIG_DRM_I915_FBDEV) += intel_fb.o +i915-$(CONFIG_DRM_I915_FBDEV) += intel_fbdev.o obj-$(CONFIG_DRM_I915) += i915.o
drivers/gpu/drm/i915/i915_dma.c +1 -1
@@ -1823,7 +1823,7 @@ void i915_driver_lastclose(struct drm_device * dev)return ;if (drm_core_check_feature (dev,DRIVER_MODESET )) { -intel_fb_restore_mode (dev); +intel_fbdev_restore_mode (dev);vga_switcheroo_process_delayed_switch ();return ; }
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -9172,14 +9172,14 @@ intel_user_framebuffer_create(struct drm_device *dev, }#ifndef CONFIG_DRM_I915_FBDEV -static inline void intel_fb_output_poll_changed (struct drm_device *dev) +static inline void intel_fbdev_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, + .output_poll_changed = intel_fbdev_output_poll_changed, };/* Set up chip specific display functions */
drivers/gpu/drm/i915/intel_drv.h +3 -3
@@ -840,8 +840,8 @@ 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); +extern void intel_fbdev_output_poll_changed (struct drm_device *dev); +extern void intel_fbdev_restore_mode (struct drm_device *dev);#else static inline int intel_fbdev_init (struct drm_device *dev) {
@@ -860,7 +860,7 @@ static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state) { } -static inline void intel_fb_restore_mode (struct drm_device *dev) +static inline void intel_fbdev_restore_mode (struct drm_device *dev) { }#endif
drivers/gpu/drm/i915/intel_fb.c deleted +0 -314
314 lines not on this page · raw message
drivers/gpu/drm/i915/intel_fbdev.c new file +314 -0
314 lines not on this page · raw message
Signature · 6 lines
1.7.11.7 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi
Quoted 6 lines · Daniel Vetter
Hi all,
So I've taken a look again at the locking mess in our fbdev support and cried. Fixing up the
console_lockmess around the fbdev notifier will be real work, semanatically the fbdev layer does lots of stupid things (like the radeon resume issue I've just debugged) and the panic notifier is pretty much a lost cause.
Hint: Take a look at fbdev ref-counting or sysfs integration. Totally broken, too. I sometimes really wonder how that still works.
Quoted 1 line
So I've decided to instead rip it all out. It seems to work \o/
Yep, works for me pretty well, too.
Quoted 4 lines
Of course a general purpose distro propably wants David's kmscon for any fallbacks needs and a system compositor to ditch the VT subsystem - atm my machine here runs with the dummy console so that VT switching between different X sessions still works ;-)
I used CONFIG_VT=n for quite a while with user-space VTs as replacement. But what we really need is a system-compositor (even if it's not really a "compositor"). But for that we need dynamic modeset nodes or we end up with the same problems as with VTs. It's on my TODO list after render/modeset nodes are done. With user-space VTs this is even backwards-compatible.
Quoted 6 lines
Oh and: At least fedora's boot splash seems to be unhappy about the lack of an fbdev (it doesn't seem to do anything), which breaks early disk encryption a bit. The black screen itself shouldn't be a big issue at least for i915, since with all the fastboot work we can just hang onto the current config and framebuffer (one missing patch from Chris for the fb preservartion). So as long as the bios/grub put up something nice, it'll look ok.
Plymouth should work just fine with KMS (afaik it was even airlied who wrote the backends). It doesn't support GPU hotplugging, though. So it's probably started before i915 is loaded and so doesn't pick up the DRM device. Or with initrd user-space is started early without waiting for device-initialization to finish. So even with i915 built-in it may run before card0 shows up. The journal-log should probably help debugging this.
Btw., It has /dev/dri/card0 hard-coded and only tries opening it once during startup.
Quoted 2 lines
So just a small step here really, but imo into the right direction. Now, please bring on the flames!
Please, apply it! Now!
Thanks
David
Quoted 53 lines
Aside: We can hide the #ifdef mess a bit better in drm/i915 I think, but I'd like to wait for a bit of feedback first. And one more: This also removes the
console_lockcompletely from our critical path in suspend/resume!One thing I haven't wasted a single thought about is kgdb and panic notifier support. But since the current code is pretty decently broken already (we have _tons_ of mutex grabbing and waits in there) I don't think people care that much about it anyway. Using a sprite to smash the kgdb/panic output on top of whatever's currently displaying might be an approach.
Cheers, Daniel
Daniel Vetter (3):
drm: Add separateKconfigoption for fbdev helpers drm/i915:Kconfigoption to disable the legacy fbdev support drm/i915: renameintel_fb.ctointel_fbdev.cdrivers/gpu/drm/Kconfig | 57 ++----- drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/ast/Kconfig | 1 + drivers/gpu/drm/cirrus/Kconfig | 1 + drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/i915/Kconfig | 56 +++++++ drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_debugfs.c | 4 +- drivers/gpu/drm/i915/i915_dma.c | 8 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_display.c | 12 +- drivers/gpu/drm/i915/intel_drv.h | 39 ++++- drivers/gpu/drm/i915/intel_fb.c | 314 ----------------------------------- drivers/gpu/drm/i915/intel_fbdev.c | 314 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/mgag200/Kconfig | 1 + drivers/gpu/drm/nouveau/Kconfig | 1 + drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/qxl/Kconfig | 1 + drivers/gpu/drm/shmobile/Kconfig | 1 + drivers/gpu/drm/tilcdc/Kconfig | 1 + drivers/gpu/drm/udl/Kconfig | 1 + drivers/gpu/host1x/drm/Kconfig | 1 + drivers/staging/imx-drm/Kconfig | 1 + 24 files changed, 452 insertions(+), 373 deletions(-) create mode 100644 drivers/gpu/drm/i915/Kconfig delete mode 100644 drivers/gpu/drm/i915/intel_fb.c create mode 100644 drivers/gpu/drm/i915/intel_fbdev.c--
1.7.11.7_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Daniel Vetter
Hi all,
So I've taken a look again at the locking mess in our fbdev support and cried. Fixing up the
console_lockmess around the fbdev notifier will be real work, semanatically the fbdev layer does lots of stupid things (like the radeon resume issue I've just debugged) and the panic notifier is pretty much a lost cause.So I've decided to instead rip it all out. It seems to work \o/
When you say 'locking mess in our fbdev support' you mean the general core fbdev driver? Not neccessarily the i915 driver?
I am asking b/c that would imply that the other fbdev drivers still hit the locking mess?
Thanks!
Quoted 69 lines
Of course a general purpose distro propably wants David's kmscon for any fallbacks needs and a system compositor to ditch the VT subsystem - atm my machine here runs with the dummy console so that VT switching between different X sessions still works ;-)
Oh and: At least fedora's boot splash seems to be unhappy about the lack of an fbdev (it doesn't seem to do anything), which breaks early disk encryption a bit. The black screen itself shouldn't be a big issue at least for i915, since with all the fastboot work we can just hang onto the current config and framebuffer (one missing patch from Chris for the fb preservartion). So as long as the bios/grub put up something nice, it'll look ok.
So just a small step here really, but imo into the right direction. Now, please bring on the flames!
Aside: We can hide the #ifdef mess a bit better in drm/i915 I think, but I'd like to wait for a bit of feedback first. And one more: This also removes the
console_lockcompletely from our critical path in suspend/resume!One thing I haven't wasted a single thought about is kgdb and panic notifier support. But since the current code is pretty decently broken already (we have _tons_ of mutex grabbing and waits in there) I don't think people care that much about it anyway. Using a sprite to smash the kgdb/panic output on top of whatever's currently displaying might be an approach.
Cheers, Daniel
Daniel Vetter (3):
drm: Add separateKconfigoption for fbdev helpers drm/i915:Kconfigoption to disable the legacy fbdev support drm/i915: renameintel_fb.ctointel_fbdev.cdrivers/gpu/drm/Kconfig | 57 ++----- drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/ast/Kconfig | 1 + drivers/gpu/drm/cirrus/Kconfig | 1 + drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/i915/Kconfig | 56 +++++++ drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_debugfs.c | 4 +- drivers/gpu/drm/i915/i915_dma.c | 8 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_display.c | 12 +- drivers/gpu/drm/i915/intel_drv.h | 39 ++++- drivers/gpu/drm/i915/intel_fb.c | 314 ----------------------------------- drivers/gpu/drm/i915/intel_fbdev.c | 314 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/mgag200/Kconfig | 1 + drivers/gpu/drm/nouveau/Kconfig | 1 + drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/qxl/Kconfig | 1 + drivers/gpu/drm/shmobile/Kconfig | 1 + drivers/gpu/drm/tilcdc/Kconfig | 1 + drivers/gpu/drm/udl/Kconfig | 1 + drivers/gpu/host1x/drm/Kconfig | 1 + drivers/staging/imx-drm/Kconfig | 1 + 24 files changed, 452 insertions(+), 373 deletions(-) create mode 100644 drivers/gpu/drm/i915/Kconfig delete mode 100644 drivers/gpu/drm/i915/intel_fb.c create mode 100644 drivers/gpu/drm/i915/intel_fbdev.cSignature · 6 lines
1.7.11.7 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Konrad Rzeszutek Wilk
Quoted 7 lines · Daniel Vetter
Hi all,
So I've taken a look again at the locking mess in our fbdev support and cried. Fixing up the
console_lockmess around the fbdev notifier will be real work, semanatically the fbdev layer does lots of stupid things (like the radeon resume issue I've just debugged) and the panic notifier is pretty much a lost cause.
Quoted 8 lines
Quoted 1 line
So I've decided to instead rip it all out. It seems to work \o/
When you say 'locking mess in our fbdev support' you mean the general core fbdev driver? Not neccessarily the i915 driver?
I am asking b/c that would imply that the other fbdev drivers still hit the locking mess?
Yeah, the recent thing I've stumbled over is how the the fbdev/fbcon locking proliferates console_lock protected sections like mad. Which means that the initial modeset (for fbcon) is all done with the console_lock held. Which makes debugging things in that rather tricky code a mess. So nothing i915-specifc.
-Daniel
Quoted 71 lines
Thanks!
Quoted 69 lines
Of course a general purpose distro propably wants David's kmscon for any fallbacks needs and a system compositor to ditch the VT subsystem - atm my machine here runs with the dummy console so that VT switching between different X sessions still works ;-)
Oh and: At least fedora's boot splash seems to be unhappy about the lack of an fbdev (it doesn't seem to do anything), which breaks early disk encryption a bit. The black screen itself shouldn't be a big issue at least for i915, since with all the fastboot work we can just hang onto the current config and framebuffer (one missing patch from Chris for the fb preservartion). So as long as the bios/grub put up something nice, it'll look ok.
So just a small step here really, but imo into the right direction. Now, please bring on the flames!
Aside: We can hide the #ifdef mess a bit better in drm/i915 I think, but I'd like to wait for a bit of feedback first. And one more: This also removes the
console_lockcompletely from our critical path in suspend/resume!One thing I haven't wasted a single thought about is kgdb and panic notifier support. But since the current code is pretty decently broken already (we have _tons_ of mutex grabbing and waits in there) I don't think people care that much about it anyway. Using a sprite to smash the kgdb/panic output on top of whatever's currently displaying might be an approach.
Cheers, Daniel
Daniel Vetter (3):
drm: Add separateKconfigoption for fbdev helpers drm/i915:Kconfigoption to disable the legacy fbdev support drm/i915: renameintel_fb.ctointel_fbdev.cdrivers/gpu/drm/Kconfig | 57 ++----- drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/ast/Kconfig | 1 + drivers/gpu/drm/cirrus/Kconfig | 1 + drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/gma500/Kconfig | 1 + drivers/gpu/drm/i915/Kconfig | 56 +++++++ drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_debugfs.c | 4 +- drivers/gpu/drm/i915/i915_dma.c | 8 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_display.c | 12 +- drivers/gpu/drm/i915/intel_drv.h | 39 ++++- drivers/gpu/drm/i915/intel_fb.c | 314 ----------------------------------- drivers/gpu/drm/i915/intel_fbdev.c | 314 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/mgag200/Kconfig | 1 + drivers/gpu/drm/nouveau/Kconfig | 1 + drivers/gpu/drm/omapdrm/Kconfig | 1 + drivers/gpu/drm/qxl/Kconfig | 1 + drivers/gpu/drm/shmobile/Kconfig | 1 + drivers/gpu/drm/tilcdc/Kconfig | 1 + drivers/gpu/drm/udl/Kconfig | 1 + drivers/gpu/host1x/drm/Kconfig | 1 + drivers/staging/imx-drm/Kconfig | 1 + 24 files changed, 452 insertions(+), 373 deletions(-) create mode 100644 drivers/gpu/drm/i915/Kconfig delete mode 100644 drivers/gpu/drm/i915/intel_fb.c create mode 100644 drivers/gpu/drm/i915/intel_fbdev.c--
1.7.11.7_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Zoltan Nyul
Reviewed-byRe: [PATCH 0/8] Don't let the ghost eDP haunt us
This patch series seems ok for me.
Quoted 32 lines
Hi
This week I sent a patch called "drm/i915: propagate errors from
intel_dp_init_connector" to fix a Haswell bug that was preventing my machine from booting. Chris provided a nice suggestion for it, so this series should implement his suggestion, but split in a few patches. While writing this code I also spotted a few other things, so there are some patches for them here. Patch 3 is the real bug fix and patches 4 & 5 implement Chris's suggestions. Patch 1 is another bug fix and patches 2, 6, 7 & 8 are my bikesheds for the current code.Thanks,
PauloPaulo Zanoni (8):
drm/i915: don't check encoder at DP connectordestroy()drm/i915: extractintel_edp_init_connector
drm/i915: propagate errors fromintel_dp_init_connectordrm/i915: fix the "ghost eDP" connector unwind path drm/i915: fix the "ghost eDP" encoder unwind path drm/i915: check the return value ofintel_dp_i2c_initdrm/i915: invert the verbosity ofintel_enable_fbcdrm/i915: renameintel_dp_destroytointel_dp_connector_destroydrivers/gpu/drm/i915/intel_ddi.c | 7 +- drivers/gpu/drm/i915/intel_dp.c | 180 +++++++++++++++++++++++---------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_pm.c | 3 +- 4 files changed, 113 insertions(+), 79 deletions(-)--
1.8.1.2
Quoted 8 lines · Daniel Vetter
Hi all,
So I've taken a look again at the locking mess in our fbdev support and cried. Fixing up the
console_lockmess around the fbdev notifier will be real work, semanatically the fbdev layer does lots of stupid things (like the radeon resume issue I've just debugged) and the panic notifier is pretty much a lost cause.So I've decided to instead rip it all out. It seems to work \o/
I wonder how badly this breaks on EFI systems. Currently, efifb is an fbdev driver. When i915 calls register_framebuffer, the fbdev core removes efifb's framebuffer. (This is scary already -- what if i915 has reused that memory for something else beforehand?) But now, if i915 doesn't call register_framebuffer, the efifb "framebuffer" might stick around forever.
Presumably, efifb ought to become a framebuffer-only drm driver and there should be a saner way to hand control from efifb (or vesa?) to a real driver.
--Andy
Hi
Quoted 8 lines · Andy Lutomirski
Quoted 7 lines · Daniel Vetter
Hi all,
So I've taken a look again at the locking mess in our fbdev support and cried. Fixing up the
console_lockmess around the fbdev notifier will be real work, semanatically the fbdev layer does lots of stupid things (like the radeon resume issue I've just debugged) and the panic notifier is pretty much a lost cause.
Quoted 8 lines
Quoted 1 line
So I've decided to instead rip it all out. It seems to work \o/
I wonder how badly this breaks on EFI systems. Currently, efifb is an fbdev driver. When i915 calls
register_framebuffer, the fbdev core removes efifb's framebuffer. (This is scary already -- what if i915 has reused that memory for something else beforehand?) But now, if i915 doesn't callregister_framebuffer, the efifb "framebuffer" might stick around forever.
See the i915 Patch (2/3). It still calls remove_conflicting_framebuffers() if CONFIG_FB is enabled. This will kick out efifb regardless whether i915-fbdev support is enabled or not.
Quoted 3 lines
Presumably, efifb ought to become a framebuffer-only drm driver and there should be a saner way to hand control from efifb (or vesa?) to a real driver.
Already working on it.
Regards
David