fbmem, drm/nouveau: kick firmware framebuffers as soon as possible
Subsystems (4)
PATCH v2 2/3 fbmem, drm/nouveau: kick firmware framebuffers as soon as possible
Currently vesafb/efifb/... is kicked when hardware driver is registering framebuffer. To do it hardware must be fully functional, so there's a short window between start of initialisation and framebuffer registration when two drivers touch the hardware. Unfortunately sometimes it breaks nouveau initialisation.
Fix it by kicking firmware driver(s) before we start touching the hardware.
Reported-by Didier Spaier <[email protected]>
Tested-by Didier Spaier <[email protected]>
Signed-off-by Marcin Slusarz <[email protected]>
Cc Ben Skeggs <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Peter Jones <[email protected]>
Cc Andrew Morton <[email protected]>
---
no changes since last submission
--- drivers/gpu/drm/nouveau/nouveau_drv.h | 2 + drivers/gpu/drm/nouveau/nouveau_fbcon.c | 19 +------------- drivers/gpu/drm/nouveau/nouveau_state.c | 43 +++++++++++++++++++++++++++++++ drivers/video/fbmem.c | 43 ++++++++++++++++++------------- include/linux/fb.h | 1 + 5 files changed, 72 insertions(+), 36 deletions(-)
drivers/gpu/drm/nouveau/nouveau_drv.h +2 -0
@@ -621,6 +621,8 @@ struct drm_nouveau_private {struct {struct dentry *channel_root; } debugfs; + +struct apertures_struct *apertures; }; static inline struct drm_nouveau_private *
drivers/gpu/drm/nouveau/nouveau_fbcon.c +1 -18
@@ -194,7 +194,6 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width,struct drm_mode_fb_cmd mode_cmd;struct pci_dev *pdev = dev->pdev;struct device *device = &pdev->dev; -struct apertures_struct *aper;int size, ret; mode_cmd.width = surface_width;
@@ -281,28 +280,12 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width, info->fix.mmio_len =pci_resource_len (pdev,1 );/* Set aperture base/size for vesafb takeover */ - aper = info->apertures =alloc_apertures (3 ); + info->apertures = dev_priv->apertures;if (!info->apertures) { ret = -ENOMEM ; goto out_unref; } - aper->ranges[0 ].base =pci_resource_start (pdev,1 ); - aper->ranges[0 ].size =pci_resource_len (pdev,1 ); - aper->count =1 ; - -if (pci_resource_len (pdev,2 )) { - aper->ranges[aper->count].base =pci_resource_start (pdev,2 ); - aper->ranges[aper->count].size =pci_resource_len (pdev,2 ); - aper->count++; - } - -if (pci_resource_len (pdev,3 )) { - aper->ranges[aper->count].base =pci_resource_start (pdev,3 ); - aper->ranges[aper->count].size =pci_resource_len (pdev,3 ); - aper->count++; - } - info->pixmap.size =64 *1024 ; info->pixmap.buf_align =8 ; info->pixmap.access_align =32 ;
drivers/gpu/drm/nouveau/nouveau_state.c +43 -0
55 lines not on this page · raw message
drivers/video/fbmem.c +25 -18
63 lines not on this page · raw message
include/linux/fb.h +1 -0
@@ -971,6 +971,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,/* drivers/video/fbmem.c */ extern int register_framebuffer (struct fb_info *fb_info);extern int unregister_framebuffer (struct fb_info *fb_info); +extern void remove_conflicting_framebuffers (struct apertures_struct *a,const char *name);extern int fb_prepare_logo (struct fb_info *fb_info,int rotate);extern int fb_show_logo (struct fb_info *fb_info,int rotate);extern char *fb_get_buffer_offset (struct fb_info *info,struct fb_pixmap *buf,u32 size);
Signature · 1 line
1.7.1