Discussion:
[directfb-users] Understanding PrimaryTestRegion and PrimarySetRegion
Franklin Cooper Jr.
2015-02-23 02:54:14 UTC
Permalink
Hi,

I'm working on a embedded Linux platform trying enable hardware based
scaling for various software that use SDL which uses the DirectFB v1.7.1
backend.

The hardware can pretty much scale anything so I simply need DirectFB to
call the fbdev IOCTL to set it to the resolution that it wants. However, I
also need to enter a bunch of resolutions in fb.modes or DirectFB won't
even attempt to set the resolution. After I do this for some reason I am
seeing a bunch of calls to PrimaryTestRegion and only a single call
to primarySetRegion. My assumption would be that primarySetRegion would be
called every time DirectFB_SetVideoMode is called. However that isn't
true. I am seeing the following


Right now I have 9 set of modes in fb.modes and this is the pattern I am
seeing.


4x PrimaryTestRegion Call (based on the resolution of the first mode entry
of fb.modes)

PrimarySetRegion Call (based on the resolution of the first mode entry of
fb.modes)

5x PrimaryTestRegion Call (based on the resolution of the first mode entry
of fb.modes)

SDL_GetVideoMode/DirectFB_SetVideoMode (first and only time its called)

5x PrimaryTestRegion Call (based on the PROPER resolution SDL is asking)

However, since PrimartSetRegion is never called the resolution I want is
never being set but the first resolution specified in fb.modes is the only
one that is used.

I'm not sure I understand the logic of why when fb.modes is used I'm not
getting the resolution I really want. I even did a test where I deleted
fb.modes and I see a similar issue but this time the first available "mode"
is my screen's default resolution. What is even more confusing is why is
DirectFB setting anything before SDL has even requested for a video mode to
be set.

Loading...