diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2018-07-25 09:41:55 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2018-07-25 09:41:55 -0400 |
commit | 2c29cfc3eaf11779176bf41475cfca49bccba11c (patch) | |
tree | 8006c93072ddf1325ba670c60f007007d9d223dd | |
parent | 564f1807379298dfdb12ed0d5b25fcb89c238527 (diff) |
udlfb: make a local copy of fb_ops
The defio subsystem overwrites the method fb_osp->mmap. That method is
stored in module's static data - and that means that if we have multiple
diplaylink adapters, they will over write each other's method.
In order to avoid interference between multiple adapters, we copy the
fb_ops structure to a device-local memory.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r-- | drivers/video/fbdev/udlfb.c | 3 | ||||
-rw-r--r-- | include/video/udlfb.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index fa63a2e359d6..770c1c8cfbd0 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c | |||
@@ -1665,7 +1665,8 @@ static void dlfb_init_framebuffer_work(struct work_struct *work) | |||
1665 | dlfb->info = info; | 1665 | dlfb->info = info; |
1666 | info->par = dlfb; | 1666 | info->par = dlfb; |
1667 | info->pseudo_palette = dlfb->pseudo_palette; | 1667 | info->pseudo_palette = dlfb->pseudo_palette; |
1668 | info->fbops = &dlfb_ops; | 1668 | dlfb->ops = dlfb_ops; |
1669 | info->fbops = &dlfb->ops; | ||
1669 | 1670 | ||
1670 | retval = fb_alloc_cmap(&info->cmap, 256, 0); | 1671 | retval = fb_alloc_cmap(&info->cmap, 256, 0); |
1671 | if (retval < 0) { | 1672 | if (retval < 0) { |
diff --git a/include/video/udlfb.h b/include/video/udlfb.h index bc2e9cf34aa5..b4f43d3ac1af 100644 --- a/include/video/udlfb.h +++ b/include/video/udlfb.h | |||
@@ -51,6 +51,7 @@ struct dlfb_data { | |||
51 | int base8; | 51 | int base8; |
52 | u32 pseudo_palette[256]; | 52 | u32 pseudo_palette[256]; |
53 | int blank_mode; /*one of FB_BLANK_ */ | 53 | int blank_mode; /*one of FB_BLANK_ */ |
54 | struct fb_ops ops; | ||
54 | /* blit-only rendering path metrics, exposed through sysfs */ | 55 | /* blit-only rendering path metrics, exposed through sysfs */ |
55 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ | 56 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ |
56 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ | 57 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ |