Re: [PATCH 3/3] drm/msm: hijack firmware fb's memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 11, 2017 at 3:38 PM, Rob Clark <robdclark@xxxxxxxxx> wrote:
> +static unsigned long hijack_firmware_fb(struct drm_device *dev)
> +{
> +       struct msm_drm_private *priv = dev->dev_private;
> +       unsigned long size;
> +       int i;
> +
> +       /* if we have simplefb/efifb, find it's aperture and hijack
> +        * that before we kick out the firmware fb's.
> +        *
> +        * TODO we probably should hold registration_lock
> +        */
> +       for (i = 0; i < FB_MAX; i++) {
> +               struct fb_info *fb = get_fb_info(i);
> +
> +               if (IS_ERR_OR_NULL(fb))
> +                       continue;
> +
> +               if (!fb->apertures->count)
> +                       continue;
> +
> +               /* if we find efifb or simplefb, we are about to
> +                * kick them out, so hijack their memory:
> +                */
> +               if ((strcmp(fb->fix.id, "EFI VGA") == 0) ||
> +                               (strcmp(fb->fix.id, "simple") == 0)) {
> +
> +                       priv->vram.paddr = fb->apertures->ranges[0].base;
> +                       size = fb->apertures->ranges[0].size;
> +               }
> +
> +               put_fb_info(fb);
> +
> +               if (size)
> +                       return size;
> +       }
> +
> +       return 0;
> +}

I think this should be a helper function in at least drm_fb_helper.c,
which would then fill in both base&size in a passed-in struct. But
yeah this seems a lot better than the old one.

In the future we could then also extend this with kicking out other
firmware fb things.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux