Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <mackan@stacken.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Sun, 07 Mar 1999 00:30:59 +0000

Re: DGA target kills my X.

Daniel Elenius wrote:
> 
> >What X-server, mode and application did you use then?
> >And which snapshot?
> 
> I use the Riva TNT X-server (XFree 3.3.2),

If X crashes it's most likely because of the server - IIRC that
server is more or less experimental.

> I run it in 1024x768x32bpp,
> I have snapshot 990305, and like I said, i tried it with e.g. the warp
> demo. The message only appeared when I ran it as root:
> 
> root@i203:/usr/src/degas/lib/libggi/programs/demos/warp-ggi# ./warp cthugha.pcx
> LibGGI: Failed to set mode: 320x200.[P8/8]
> Error switching to 320x200 8 bpp mode.
> Under X, try using -d depth_of_your_screen.

Normal, as X can't change bit depth on the fly.

> root@i203:/usr/src/degas/lib/libggi/programs/demos/warp-ggi# ./warp cthugha.pcx  -d 32
> LibGGI: Failed to set mode: 320x200.[C24/32]
                                           ^^
> Error switching to 320x200 32 bpp mode.
                             ^^
> Under X, try using -d depth_of_your_screen.

This is not what your first message said. It had 24 in the two marked
places, which looked highly weird.
The above error is most likely because you have no ModeLine for
320x200 in your XFree config file. XFree requires a ModeLine for
each mode you want to use.

> When I ran it as normal user, I got another error:
> 
> daniel@i203:/usr/src/degas/lib/libggi/programs/demos/warp-ggi$ warp cthugha.pcx_ggi_XF86DGAGetVideo: failed to open /dev/mem (Permission denied)
> display-DGA: Unable to map video memory!
> Error opening GGI display.

Yes DGA requires permission to mmap() the video memory.

> Should I give "daniel" the same permissions as root to /dev/mem? I
> tried that, but the same message appeared.

Not recommended. /dev/mem is a security hole and should have
permissions 0600 and be owned by root.

But note that the DGA that LibGGI uses has an extra feature:
If you have a fbcon driver for your card loaded you can set
GGI_DGA_FBDEV=<device> where <device> is the framebuffer device node,
and then the DGA target will mmap() that instead, thus you only
need permissions on <device> instead of /dev/mem.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan/
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: mackan@stacken.kth.se

Index: [thread] [date] [subject] [author]