DSS2 answers

410 views
Skip to first unread message

Brett Kuehner

unread,
Mar 13, 2009, 5:19:56 PM3/13/09
to beagl...@googlegroups.com
I've found answers for a few questions I asked previously, so I
figured I'd write them up here in case other people are trying the
same things. Some of this is probably obvious to a lot of you, but
since I'm still relatively new to playing with kernels in general and
the DSS in specific, I'm including all the stuff I had to collect and
understand from various documents. If you see anything I got wrong,
please correct me.
I also have a few more questions which I'll post separately.

I've been playing with Tomi's 2.6.29 DSS2 kernel ( from
http://www.bat.org/~tomba/git/linux-omap-dss.git ), and trying to
understand overlays, scaling, and other parts of it. So far, I have it
running at my desired 1024x768 resolution to a DVI monitor, I have
multiple framebuffers and overlays going, and some scaling. Everything
here is specific to that kernel, and will not work on the current
OE/Angstrom 2.6.28 kernel, which (at least right now) has a different
set of sysfs interfaces and kernel arguments.

To get 1024x768 with 3 framebuffers, I built the kernel with these
settings under Device Drivers/Graphics support/OMAP2/3 Display
Subsystem support (and the submenus):
VRAM size of 12 (OMAP2_DSS_VRAM_SIZE=12)
DSI Support=N (OMAP2_DSS_DSI=n)
Minimum FCK/PCK ratio of 0 (OMAP2_DSS_MIN_FCK_PER_PCK=0)
Debug support (OMAP2_DSS_DEBUG=y)
Number of Framebuffers = 3 (FB_OMAP2_NUM_FBS=3)
Debug support for OMAP2/3 FB = Y (FB_OMAP2_DEBUG_SUPPORT=y)

boot args for omap graphics:
omapfb.debug=y omapdss.debug=y omapdss.def_disp=dvi omapfb.test=y
omapfb.mode=dvi:1024x768MR-24@60 omapfb.vram=0:3M,1:3M,2:3M

These (in combination with the "debug" general kernel argument), do
the following:
turn on debugging printouts that are useful (omapfb.debug=y omapdss.debug=y)
make the default display the dvi (omapdss.def_disp=dvi)
turn on a test-pattern display for the framebuffers (omapfb.test=y)
set the video mode for the dvi display to 1024x768 at 60Hz and
tightened timings (omapfb.mode=dvi:1024x768MR-24@60)
allocated 3MB of memory for each of the 3 framebuffers
(omapfb.vram=0:3M,1:3M,2:3M)

Once the system is booted with this set of arguments, you should have
3 framebuffers which are the source bitmaps to be scaled, overlayed,
and placed on screen. You can control the scaling and positioning from
the shell using fbset and the sysfs (/sys) interface. This is
documented in Documentation/arm/OMAP/DSS, but I've added some more
examples below. They assume you start off with the standard connection
of fb0 -> overlay 0 -> manager 0/lcd and fb1 -> overlay 1 -> manager
0/lcd
If you have the test pattern generator turned on (via the
omapfb.test=y bootarg), you will see these effects as scaling and
positioning of the test patterns, or you can write your own data to
the framebuffers (I've been cat-ing raw 24bit bitmaps to the /dev/fb
devices as a quick and dirty way to get images onscreen, although
upside-down and backwards)

#first, define some handy shortcut variables
ovl0=/sys/devices/platform/omapdss/overlay0
ovl1=/sys/devices/platform/omapdss/overlay1
mgr0=/sys/devices/platform/omapdss/manager0
lcd=/sys/devices/platform/omapdss/display0

fb0=/sys/class/graphics/fb0
fb1=/sys/class/graphics/fb1

# turn on the display of fb1 (connected to overlay 1)
echo "1" > $ovl1/enabled

# to set scaling of fb1 to half-width horizontally
echo "512,768" > $ovl1/output_size
# to slide the scaled fb1 to the middle of the screen (so you'll see
it in the middle, with the fb0 image peeking through behind it on both
sides)
echo "256,0" > $ovl1/position

# run mplayer with video going to the scaled, positioned, and overlayed fb1
mplayer -vo fbdev:/dev/fb1 file.avi

You apparently can't scale the fb0/gfx overlay, as the OMAP doesn't
seem to have a scaler attached to it. But you can change the
resolution and position of it:
fbset -fb /dev/fb0 -xres 512 -yres 384
echo "100,100" > $ovl0/position

# to turn off the display, manager, and overlay (maybe required before
doing certain operations)
# also useful if things are messed up, you can fix the parameter that
caused the problem, turn everything off and then back on again
echo "0" > $lcd/enabled
echo "" > $mgr0/display
echo "0" > $ovl1/enabled

# to turn them all back on (useful after you've turned things off)
echo "1" > $ovl1/enabled
echo "dvi" > $mgr0/display
echo "1" > $lcd/enabled


So, that's what I've sorted out so far. I hope it is useful to someone
(or several someones).

Brett

Tomi Valkeinen

unread,
Mar 13, 2009, 5:47:45 PM3/13/09
to beagl...@googlegroups.com
Hi,

On Fri, 13 Mar 2009, Brett Kuehner wrote:

>
> I've found answers for a few questions I asked previously, so I
> figured I'd write them up here in case other people are trying the
> same things. Some of this is probably obvious to a lot of you, but
> since I'm still relatively new to playing with kernels in general and
> the DSS in specific, I'm including all the stuff I had to collect and
> understand from various documents. If you see anything I got wrong,
> please correct me.

Nice examples, and everything seems to be correct.

I know the DSS2 documentation sucks, but was there something about DSS2
that was especially confusing? I could perhaps improve just those parts
while waiting for the inspiration to write better documentation.

Tomi

Ps. To everyone: patches for documentation are accepted! =)

Brett Kuehner

unread,
Mar 13, 2009, 6:33:29 PM3/13/09
to beagl...@googlegroups.com
On Fri, Mar 13, 2009 at 5:47 PM, Tomi Valkeinen <to...@iki.fi> wrote:
>
> Hi,
>
> On Fri, 13 Mar 2009, Brett Kuehner wrote:
>
>>
>> I've found answers for a few questions I asked previously, so I
>> figured I'd write them up here in case other people are trying the
>> same things. Some of this is probably obvious to a lot of you, but
>> since I'm still relatively new to playing with kernels in general and
>> the DSS in specific, I'm including all the stuff I had to collect and
>> understand from various documents. If you see anything I got wrong,
>> please correct me.
>
> Nice examples, and everything seems to be correct.
>
> I know the DSS2 documentation sucks, but was there something about DSS2
> that was especially confusing? I could perhaps improve just those parts
> while waiting for the inspiration to write better documentation.
>
>  Tomi
>
> Ps. To everyone: patches for documentation are accepted! =)


The main problems I had were figuring out which examples applied to
which kernel, and the precise format of the kernel arguments, and the
fact that you need to allocate VRAM for each framebuffer, and the fact
the the GFX plane can't be scaled. The DSS/DSS2a (? in Angstrom
2.6.28) and DSS2b (in your 2.6.29) require some time to sort through,
especially when reading various posts and wikis. Ultimately the
information is there, it is just hard to form a single coherent
picture.

I've never submitted a patch, but I'd be happy to give it a shot if
you can point me at a set of instructions somewhere.

Brett

Tomi Valkeinen

unread,
Mar 13, 2009, 6:51:52 PM3/13/09
to beagl...@googlegroups.com

On Fri, 13 Mar 2009, Brett Kuehner wrote:

>
> On Fri, Mar 13, 2009 at 5:47 PM, Tomi Valkeinen <to...@iki.fi> wrote:
>>

...

>>
>> Ps. To everyone: patches for documentation are accepted! =)
>
>
> The main problems I had were figuring out which examples applied to
> which kernel, and the precise format of the kernel arguments, and the
> fact that you need to allocate VRAM for each framebuffer, and the fact
> the the GFX plane can't be scaled. The DSS/DSS2a (? in Angstrom
> 2.6.28) and DSS2b (in your 2.6.29) require some time to sort through,
> especially when reading various posts and wikis. Ultimately the
> information is there, it is just hard to form a single coherent
> picture.
>
> I've never submitted a patch, but I'd be happy to give it a shot if
> you can point me at a set of instructions somewhere.

If you want to write documentation, you can just improve the
Documentation/arm/OMAP/DSS file and send it to me. I can easily see the
diff, so no patches needed for this if you are not familiar with
patching.

Clear real life examples with comments are perhaps most needed.

I have also been thinking of a DSS2 wiki-page somewhere, but I don't have
any place for that. And perhaps a wiki page is an overkill for a simple
linux driver.

Tomi

Reply all
Reply to author
Forward
0 new messages