# Re: \[PATCH 48/57\] fbdev: sh\_mobile\_meram: Allocate ICBs automatically

- From: Damian Hobson-Garcia \<hidden\>
- Date: 2011-12-15 02:58:12 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2011/12/13462350
- Thread: https://ratatoskr.run/linux-fbdev/2011/12/13462349/t.md

```text
Hi Laurent,
On 2011/12/13 23:02, Laurent Pinchart wrote:
> Instead of manually specifying the ICBs to use in platform data,
> allocate them automatically at runtime.
> 
> The MERAM registration function now returns a pointer to an opaque MERAM
> object, which is passed to the update and unregistration functions.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

So one concern that I have about this is in regards to sharing ICBs with
user-space drivers.  Since there are user space drivers (via UIO) for
blocks like the VEU, that may want to have access to MERAM, we need
a way to communicate which ICBs are free to user space.  With the
hard-coded platform data we could easily assume that kernel drivers
would use, for example, the upper 16 ICBs and so user-space drivers were
free to use the lower 16.

One simple temporary workaround might be to provide a range of useable
ICBs in the platform data.  The MERAM memory allocation range can always
easily be tweaked by using the meram_resources structure.

Thanks,
Damian
```
