|Site sponsored by IGEL|
[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 10:46:06AM -0500, firstname.lastname@example.org wrote: > On Sun, Dec 15, 2002 at 05:22:42PM +0200, Ville Syrjälä wrote: > > On Sun, Dec 15, 2002 at 09:37:30AM -0500, email@example.com wrote: > > > 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? Yes it whould work. > > Perhaps the code assumes something about the surface > > size. > > Just prior to the CreateSurface there is a: > > SetVideoMode(dfb, width, height, bpp) This will only affect the primary layer. > 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. Bad assumption. I recommend you use GetSize() to get the actual surface size. This guarantees that you're code will work with PAL and NTSC without forcing the user to edit some config files. > > 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). The layer size is 720x486 so there's your segfault. > 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. A small change to IDirectFB_Construct() would do the trick I think. At least apps depending on EnumVideoModes() returning something useful will fail. There might be other problems too. I don't have time to go through the code right now so I'm not sure if it actually works. Can you try hardcoding the layer in IDirectFB_Construct() in idirectfb.c? - data->layer = dfb_layer_at( DLID_PRIMARY ); + data->layer = dfb_layer_at( 2 ); -- Ville Syrjälä firstname.lastname@example.org http://www.sci.fi/~syrjala/ -- Info: To unsubscribe send a mail to email@example.com with "unsubscribe directfb-dev" as subject.