tests: extend output-damage to GL shadow framebuffer
Extend the existing output-damage test to test blit_shadow_to_output() specifically. This function had problems originally, so make sure they can't reappear. The added quirk is explained in the test. An additional check of the quirk in gl_renderer_output_create() ensures that the shadow framebuffer is really used. The test could false-pass if the shadow is not used. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
@@ -196,6 +196,8 @@ enum weston_hdcp_protection {
|
|||||||
struct weston_testsuite_quirks {
|
struct weston_testsuite_quirks {
|
||||||
/** Force GL-renderer to do a full upload of wl_shm buffers. */
|
/** Force GL-renderer to do a full upload of wl_shm buffers. */
|
||||||
bool gl_force_full_upload;
|
bool gl_force_full_upload;
|
||||||
|
/** Ensure GL shadow fb is used, and always repaint it fully. */
|
||||||
|
bool gl_force_full_redraw_of_shadow_fb;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Weston test suite data that is given to compositor
|
/** Weston test suite data that is given to compositor
|
||||||
|
|||||||
@@ -1750,6 +1750,9 @@ gl_renderer_repaint_output(struct weston_output *output,
|
|||||||
|
|
||||||
if (shadow_exists(go)) {
|
if (shadow_exists(go)) {
|
||||||
/* Repaint into shadow. */
|
/* Repaint into shadow. */
|
||||||
|
if (compositor->test_data.test_quirks.gl_force_full_redraw_of_shadow_fb)
|
||||||
|
repaint_views(output, &output->region);
|
||||||
|
else
|
||||||
repaint_views(output, output_damage);
|
repaint_views(output, output_damage);
|
||||||
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
@@ -3316,10 +3319,13 @@ gl_renderer_output_create(struct weston_output *output,
|
|||||||
{
|
{
|
||||||
struct gl_output_state *go;
|
struct gl_output_state *go;
|
||||||
struct gl_renderer *gr = get_renderer(output->compositor);
|
struct gl_renderer *gr = get_renderer(output->compositor);
|
||||||
|
const struct weston_testsuite_quirks *quirks;
|
||||||
GLint internal_format;
|
GLint internal_format;
|
||||||
bool ret;
|
bool ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
quirks = &output->compositor->test_data.test_quirks;
|
||||||
|
|
||||||
go = zalloc(sizeof *go);
|
go = zalloc(sizeof *go);
|
||||||
if (go == NULL)
|
if (go == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -3357,6 +3363,9 @@ gl_renderer_output_create(struct weston_output *output,
|
|||||||
free(go);
|
free(go);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
} else if (quirks->gl_force_full_redraw_of_shadow_fb) {
|
||||||
|
weston_log("ERROR: gl_force_full_redraw_of_shadow_fb quirk used but shadow fb was not enabled.\n");
|
||||||
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
output->renderer_state = go;
|
output->renderer_state = go;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
.scale = s, \
|
.scale = s, \
|
||||||
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
|
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
|
||||||
.transform_name = #t, \
|
.transform_name = #t, \
|
||||||
|
.gl_shadow_fb = false, \
|
||||||
.meta.name = "pixman " #s " " #t, \
|
.meta.name = "pixman " #s " " #t, \
|
||||||
}, \
|
}, \
|
||||||
{ \
|
{ \
|
||||||
@@ -45,7 +46,16 @@
|
|||||||
.scale = s, \
|
.scale = s, \
|
||||||
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
|
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
|
||||||
.transform_name = #t, \
|
.transform_name = #t, \
|
||||||
.meta.name = "GL " #s " " #t, \
|
.gl_shadow_fb = false, \
|
||||||
|
.meta.name = "GL no-shadow " #s " " #t, \
|
||||||
|
}, \
|
||||||
|
{ \
|
||||||
|
.renderer = RENDERER_GL, \
|
||||||
|
.scale = s, \
|
||||||
|
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
|
||||||
|
.transform_name = #t, \
|
||||||
|
.gl_shadow_fb = true, \
|
||||||
|
.meta.name = "GL shadow " #s " " #t, \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct setup_args {
|
struct setup_args {
|
||||||
@@ -54,6 +64,7 @@ struct setup_args {
|
|||||||
int scale;
|
int scale;
|
||||||
enum wl_output_transform transform;
|
enum wl_output_transform transform;
|
||||||
const char *transform_name;
|
const char *transform_name;
|
||||||
|
bool gl_shadow_fb;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct setup_args my_setup_args[] = {
|
static const struct setup_args my_setup_args[] = {
|
||||||
@@ -118,6 +129,24 @@ fixture_setup(struct weston_test_harness *harness, const struct setup_args *arg)
|
|||||||
*/
|
*/
|
||||||
setup.test_quirks.gl_force_full_upload = true;
|
setup.test_quirks.gl_force_full_upload = true;
|
||||||
|
|
||||||
|
if (arg->gl_shadow_fb) {
|
||||||
|
/*
|
||||||
|
* A second case for GL-renderer: the shadow framebuffer
|
||||||
|
*
|
||||||
|
* This tests blit_shadow_to_output() specifically. The quirk
|
||||||
|
* forces the shadow framebuffer to be redrawn completely, which
|
||||||
|
* means the test surface will be completely filled with a new
|
||||||
|
* color regardless of damage. The blit uses damage too, and
|
||||||
|
* the damage pattern that is tested for needs to appear in
|
||||||
|
* that step.
|
||||||
|
*/
|
||||||
|
setup.test_quirks.gl_force_full_redraw_of_shadow_fb = true;
|
||||||
|
weston_ini_setup(&setup,
|
||||||
|
cfgln("[output]"),
|
||||||
|
cfgln("name=headless"),
|
||||||
|
cfgln("use-renderer-shadow=true"));
|
||||||
|
}
|
||||||
|
|
||||||
return weston_test_harness_execute_as_client(harness, &setup);
|
return weston_test_harness_execute_as_client(harness, &setup);
|
||||||
}
|
}
|
||||||
DECLARE_FIXTURE_SETUP_WITH_ARG(fixture_setup, my_setup_args, meta);
|
DECLARE_FIXTURE_SETUP_WITH_ARG(fixture_setup, my_setup_args, meta);
|
||||||
|
|||||||
Reference in New Issue
Block a user