Bug 29350 - No stencil buffer support for frogatto with Radeon HD 3200 KMS
Summary: No stencil buffer support for frogatto with Radeon HD 3200 KMS
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/R600 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
Depends on:
Reported: 2010-08-01 22:05 UTC by Ignacio R. Morelle
Modified: 2010-08-13 16:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Kernel log (2.6.35) (42.09 KB, text/plain)
2010-08-08 17:50 UTC, Ignacio R. Morelle
X.org server log (30.45 KB, text/plain)
2010-08-08 17:51 UTC, Ignacio R. Morelle

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacio R. Morelle 2010-08-01 22:05:53 UTC
The game Frogatto requires stencil buffer support in order to display an iris transition which is used when starting/switching levels during gameplay. When it doesn't detect iris support, it falls back to an alpha fading effect instead.

While it does detect a large enough stencil buffer when using the old radeon DDX in User modesetting mode, in KMS mode it doesn't, so it replaces the iris effect with the aforementioned fadeout.

The game's source code for version 1.0 can be obtained here:

The SVN trunk has the following URI:

I have noticed this issue so far with KMS on Linux 2.6.33, 2.6.34 and now, 2.6.35 and it has been the same with various Mesa and Radeon DDX revisions from the git repositories. In all cases (except 2.6.35, which I haven't tested with UMS), the stencil buffer support is available when not in KMS operation mode. It's also possible to reproduce it so far with version 1.0, and SVN revisions both before and after the 1.0 tag of the game.

The game requires SDL, SDL_ttf, SDL_mixer, Boost.regex/system/iostreams/threads, GL, GLU and GLEW to be compiled from source. The C++ code used to detect the usability of a stencil buffer (and therefore decide whether to use the iris effect or a fadeout) is roughly the following, found in src/level_runner.cpp through two small methods, is_stencil_buffer_available() and calculate_stencil_buffer_available():

> GLint stencil_buffer_bits = 0;
> glGetIntegerv(GL_STENCIL_BITS, &stencil_buffer_bits);
> return stencil_buffer_bits > 0; // if true, the stencil buffer is usable

The system configuration used for my last test:

- Debian Testing (Squeeze) amd64 with packages from the 2010-08-01 archive.
- libc (eglibc) 2.11.2.
- Mesa git master @ aef4500ca4ae9e5bc57560c6f9a32d9ad892975b (latest as of this writing), Gallium support disabled, only r600 and swrast DRI drivers compiled, GLX TLS and XCB support enabled.
- Radeon DDX from freedesktop.org @ dacaf5d827b58c39f9e5a7ac0530f9ea6e257347 (latest as of this writing) with KMS support compiled.
- libdrm @ b803918f3f77c62edf22e78cb2095be399753423 (July 1st)
- Linux 2.6.35 with drm/radeon compiled as built-in, KMS enabled by default.
- X.org server version 1.7.7.

The graphics controller is a Radeon HD 3200 (RS780M/RS780MN based, uses the ATI R600 DRI driver).
Comment 1 Ignacio R. Morelle 2010-08-08 17:50:43 UTC
Created attachment 37708 [details]
Kernel log (2.6.35)

Kernel log up to right after reproducing the bug.
Comment 2 Ignacio R. Morelle 2010-08-08 17:51:43 UTC
Created attachment 37709 [details]
X.org server log

Graphics server log up to right after reproducing the bug.
Comment 3 Ignacio R. Morelle 2010-08-08 17:55:17 UTC
Attachments #37708 and #37709 provide the kernel and X server logs after reproducing the bug, respectively.

The desktop environment in use this time was Fluxbox, so in case a compositing window manager could interfere in any way, this might prove that it isn't the case. The original report was based on the game running within KDE 4.4.5 using kwin's OpenGL compositing mode, and also when using kwin without compositing.

This also confirms that this bug is still present in the latest Git master revisions of mesa, drm and xf86-video-ati which I compiled just a few hours ago.
Comment 4 Corbin Simpson 2010-08-13 16:57:34 UTC
Closing as NOTOURBUG; leaving the following for posterity.

In UMS mode, r600c provides 8 bits of stencil on all configs, but in KMS mode, the normal wider variety of configs are available. The app used to have a call to SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1), but it was commented out for some reason. Uncommenting that line caused a stencilled config to be properly selected.

The moral: Always check your GL configs.

~ C.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.