Allocation of frame buffer at a specific memory range or address

From: Alexey Brodkin
Date: Fri Apr 15 2016 - 11:49:11 EST


Hello,

I'm wondering if there's a way to force kernel to allocate backing
memory for frame buffer in a special location?

A little bit of background below.
I continue to work on DRM driver for ARC PGU, latest
is v5 and available here -+AKA-https://lkml.org/lkml/2016/3/28/170

In current state everything more or less works but I'd like to
implement one improvement - I'd like to have an ability to specify
where in memory will be allocated frame-buffer's backing storage area.
I.e. buffer which will be read by PGU hardware.

Currently we use whatever DRM susbsystem put in +ACI-gem-+AD4-paddr+ACI-.
That's a snippet of the code which tells PGU hardware
which memory location to scan for data:
---------------------+AD4-8--------------------
arcpgu +AD0- crtc+AF8-to+AF8-arcpgu+AF8-priv(plane-+AD4-state-+AD4-crtc)+ADs-
gem +AD0- drm+AF8-fb+AF8-cma+AF8-get+AF8-gem+AF8-obj(plane-+AD4-state-+AD4-fb, 0)+ADs-

/+ACo- Telling PGU hardware where is data to read +ACo-/
arc+AF8-pgu+AF8-write(arcpgu, ARCPGU+AF8-REG+AF8-BUF0+AF8-ADDR, gem-+AD4-paddr)+ADs-
---------------------+AD4-8--------------------

But we may use a special memory area which works better
for that case, i.e. for example could be accessed faster by both
CPU and PGU hardware (like on-chip SRAM as opposed to external DDR).

And now the question is how to force DRM subsystem or just that driver
to use whatever predefined (say via device tree) location in memory
for data buffer allocation.

All thoughts on this are more than welcome.

-Alexey