DirectFB - Home of the pragmatist Roadmap


[directfb-dev] Re: how to CreateSurface on CRTC2 layer for G400
Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[directfb-dev] Re: how to CreateSurface on CRTC2 layer for G400



On Sun, Dec 15, 2002 at 05:22:42PM +0200, Ville Syrjälä wrote:
> On Sun, Dec 15, 2002 at 09:37:30AM -0500, a40e8119bbddbe7b3d281db117f19b32@interlinx.bc.ca wrote:
> > I am trying to coerce SDL compiled with DirectFB to display on the
> > G400's CRTC2.  The app. that I am trying to display on SDL DirectFB is
> > freevo.
> > 
> > All of the code examples of using CRTC2 that I have seen show creating
> > a DirectFB context, then getting layer 2 of this context, and then
> > getting the surface from the layer:
> > 
> >   DirectFBCreate(&dfb);
> >   dfb->GetDisplayLayer(dfb, 2, &crtc2);
> >   crtc2->GetSurface(crtc2, &c2frame);
> > 
> > This makes sense to me.  SDL however, _creates_ a surface (with
> > CreateSurface()) directly on the DirectFB context:
> > 
> >   DirectFBCreate(&dfb);
> >   dfb->GetDisplayLayer(dfb, 2, &layer);
> >   dfb->CreateSurface(dfb, &dsc, &surface);
> > 
> > and then operates on this surface.
> > 
> > I have tried to replace the CreateSurface() with a GetSurface() but I
> > wind up getting a segfault in the application.  Should a
> > GetSurface(layer, ...) be substitutable for a
> > CreateSurface(DFBContext, ...) or is it more complicated than that?
> 
> Yes if CreateSurface() had DSCAPS_PRIMARY.

Yes it's more complicated than that or yes it should be substituable?
(That was my fault for asking two questions at once.)  The
CreateSurface does have DSCAPS_PRIMARY

> Otherwise the surface is not
> related to any specific layer in which case you should keep using
> CreateSurface().

But how do I CreateSurface() so that it's created on the CRTC2 layer?
I want this output on my TV, not on the monitor that is (not) plugged
into head 1.

> Perhaps the code assumes something about the surface
> size.

Just prior to the CreateSurface there is a:

  SetVideoMode(dfb, width, height, bpp)

Where the latter 3 parameters are passed in from config values.  So
the only assumption is that the surface is the same size as the user
set in the config file.

> CRTC2 surface has a fixed size so you'll have to make sure the code
> understands that. 

I set the user-configurable size to 768x486 (it was 800x600).

> It doesn't. If you use CreateSurface() with DSCAPS_PRIMARY you are doing
> the same thing as primary_layer->GetSurface(). With other layers you must
> use GetSurface().

So, should the surface that GetSurface() returns be useable exactly
like a CreateSurface() with DSCAPS_PRIMARY?  In other words, my
replacing the call to CreateSurface with GetSurface() should not cause
a segfault later on?  I will go try to find the exact location of the
segfault.  Maybe that will give me more information to work with.

Thanx Ville,
b.

P.S.  With this being the 2nd graphics layer I have had to hack to be
able to use CRTC2 instead of DLID_PRIMARY, have any ideas about how to
make this sort of thing user-selectable been thought up?  I guess a
new /etc/directfbrc option could be introduced to specify the layer
you want to work on.

b.

-- 
Brian J. Murrell

Attachment: pgp00012.pgp
Description: PGP signature


Home | Main Index | Thread Index


directfb.org / Development / Old Archives