I run X in this way
/usr/bin/X vt07 -retro
to have the GUI on console 7 and the gray grid as background.
On console 1 I write
while [ 1 ] ; do cat /dev/random > /dev/fb0; done
and I see the random colored pixel on screen; I can switch over all console and see the same, but when I switch on console 7, where the XServer is active, I see the same gray grid.
How can I see what I write on /dev/fb0 in the console where X is active?
If I use fbdev driver in xorg.conf I can see the random pixel also on the GUI console, but I need to use amdgpu or radeon. Are there some X options, kernel params, module params that I have to change to write over X?
I have to run a user interface program that needs X and programs that draw in predetermined areas at the same time.
With kernel 3.9.6, X Server 1.14.4, and fglrx video driver these programs run and use the typical system
fbfd = open("/dev/fb0", O_RDWR);
if (fbfd == -1)
{
perror("Error: cannot open framebuffer device");
exit(1);
}
// Get fixed screen information
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo) == -1)
{
perror("Error reading fixed information");
exit(2);
}
// Get variable screen information
if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo) == -1)
{
perror("Error reading variable information");
exit(3);
}
// Map the device to memory
fbp = (char *) mmap(0, vinfo.yres * vinfo.pitch, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);
Now that I had to upgrade to kernel 5.11.21, X Server 1.20.11 and amdgpu driver, these programs do not draw on the console where the interface runs.
I need a pointer to a buffer where I can write to draw, if it is impossible to modify the system to be able to write then I need a function that returns me a pointer where I can write via X or some other way to be able to draw freely.