[Piglit] [PATCH] winsys-framework Default to showing window

Alexander Goins agoins at nvidia.com
Tue Nov 17 11:23:58 PST 2015


Woops, yeah, typo. Sure enough, the first one should be false.

-----Original Message-----
From: Arthur Huillet [mailto:arthur.huillet at free.fr] 
Sent: Tuesday, November 17, 2015 3:10 AM
To: Alexander Goins
Cc: piglit at lists.freedesktop.org; Arthur Huillet
Subject: Re: [Piglit] [PATCH] winsys-framework Default to showing window

Hi Alex,

You're right on the theory, but your patch seems to have an issue (read on).

On 2015-08-13 19:49, agoins wrote:
> winsys-framework incorrectly assumed that it will always have 
> ownership of the pixels in its own buffers. If using the default 
> framebuffer (i.e., when Piglit is not running in FBO mode,) ownership 
> will not be acquired unless the window is mapped.
> 
> While this is not typically a problem because buffers are separate, 
> NVIDIA's Unified Back Buffer feature makes all windows share a back 
> buffer while still conforming to the OpenGL spec. If Piglit does not 
> establish pixel ownership, its output will be clobbered by other 
> windows.
> 
> While this problem could be easily fixed by specifying
> PIGLIT_FORCE_WINDOW=1 or
> -fbo, the current default takes advantage of undefined behavior in the 
> OpenGL spec. A better solution would be to replace PIGLIT_FORCE_WINDOW 
> with PIGLIT_NO_WINDOW, a flag that allows tests to be run without 
> mapping a window or using an FBO. The default behavior, the, would be 
> to map a window.
> Really,
> though, if users want to test with offscreen rendering, they should 
> use FBOs with flag -fbo.
> 
> More information on pixel ownership here:
> https://www.opengl.org/documentation/specs/version1.1/glspec1.1/node94
> .html
> ---
>  .../piglit-framework-gl/piglit_winsys_framework.c    | 20 
> ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/util/piglit-framework-gl/piglit_winsys_framework.c
> b/tests/util/piglit-framework-gl/piglit_winsys_framework.c
> index c80e972..fcba91e 100644
> --- a/tests/util/piglit-framework-gl/piglit_winsys_framework.c
> +++ b/tests/util/piglit-framework-gl/piglit_winsys_framework.c
> @@ -53,18 +53,18 @@ run_test(struct piglit_gl_framework *gl_fw,
>           int argc, char *argv[])
>  {
>  	struct piglit_winsys_framework *winsys_fw = 
> piglit_winsys_framework(gl_fw);
> -	bool force_window = false;
> -	const char *env_force_window = getenv("PIGLIT_FORCE_WINDOW");
> +	bool no_window = false;
> +	const char *env_no_window = getenv("PIGLIT_NO_WINDOW");
> 
> 
> -	if (env_force_window != NULL) {
> -		if (strcmp(env_force_window, "0") == 0) {
> -			force_window = false;
> -		} else if (strcmp(env_force_window, "1") == 0) {
> -			force_window = true;
> +	if (env_no_window != NULL) {
> +		if (strcmp(env_no_window, "0") == 0) {
> +			no_window = true;
> +		} else if (strcmp(env_no_window, "1") == 0) {
> +			no_window = true;

So no_window is set to TRUE if the variable is "0" and if it is "1". 
That doesn't seem right.
Can you fix that?

--
A. Huillet
NVIDIA Linux graphics


More information about the Piglit mailing list