]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
udlfb: make a local copy of fb_ops
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 25 Jul 2018 13:41:55 +0000 (15:41 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Wed, 25 Jul 2018 13:41:55 +0000 (15:41 +0200)
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>
drivers/video/fbdev/udlfb.c
include/video/udlfb.h

index fa63a2e359d62a496ad21be99e27714c6cd8f42e..770c1c8cfbd087923ec1c6b2f73d256dc32fba52 100644 (file)
@@ -1665,7 +1665,8 @@ static void dlfb_init_framebuffer_work(struct work_struct *work)
        dlfb->info = info;
        info->par = dlfb;
        info->pseudo_palette = dlfb->pseudo_palette;
-       info->fbops = &dlfb_ops;
+       dlfb->ops = dlfb_ops;
+       info->fbops = &dlfb->ops;
 
        retval = fb_alloc_cmap(&info->cmap, 256, 0);
        if (retval < 0) {
index bc2e9cf34aa5f8cb5df3442dc29f334856d4abe3..b4f43d3ac1af0de2348c960e2741ccc8b35a3386 100644 (file)
@@ -51,6 +51,7 @@ struct dlfb_data {
        int base8;
        u32 pseudo_palette[256];
        int blank_mode; /*one of FB_BLANK_ */
+       struct fb_ops ops;
        /* blit-only rendering path metrics, exposed through sysfs */
        atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */
        atomic_t bytes_identical; /* saved effort with backbuffer comparison */