summaryrefslogtreecommitdiff
path: root/tests/kms_frontbuffer_tracking.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2016-02-24 18:29:16 -0300
committerPaulo Zanoni <paulo.r.zanoni@intel.com>2016-06-17 19:00:13 -0300
commit990f4578fce0f2186956489a7dbf228cbe48dcda (patch)
treeb37e202dc1343541ba109c98e9444395450e0d1d /tests/kms_frontbuffer_tracking.c
parentdc466efa976e2c2e0e9ff858e73c147acf6588ac (diff)
kms_frontbuffer_tracking: recreate the FBs at every subtest
This patch was originally written because of a workaround we were planning to merge. Later we improved the workaround so it wouldn't need this patch anymore. Then later we gave up on the workaround, but decided to go with a plan that would cause GTT mmap writes to invalidate FBC in case the frontbuffer ever had a WC mmap. So now we need the patch again because we don't want a subtest that involves an WC mmap to change the behavior of other unrelated subtests that use GTT mmaps. Even if we don't go with the current planned Kernel patch, merging this should be worth in order to avoid future related problems. v2: New commit message. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests/kms_frontbuffer_tracking.c')
-rw-r--r--tests/kms_frontbuffer_tracking.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 34c40a9e..bd7f6f68 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -711,12 +711,31 @@ static void create_shared_fb(enum pixel_format format)
PLANE_PRI, &s->big);
}
+static void destroy_fbs(enum pixel_format format)
+{
+ struct screen_fbs *s = &fbs[format];
+
+ if (!s->initialized)
+ return;
+
+ if (scnd_mode_params.connector_id) {
+ igt_remove_fb(drm.fd, &s->scnd_pri);
+ igt_remove_fb(drm.fd, &s->scnd_cur);
+ igt_remove_fb(drm.fd, &s->scnd_spr);
+ }
+ igt_remove_fb(drm.fd, &s->prim_pri);
+ igt_remove_fb(drm.fd, &s->prim_cur);
+ igt_remove_fb(drm.fd, &s->prim_spr);
+ igt_remove_fb(drm.fd, &s->offscreen);
+ igt_remove_fb(drm.fd, &s->big);
+}
+
static void create_fbs(enum pixel_format format)
{
struct screen_fbs *s = &fbs[format];
if (s->initialized)
- return;
+ destroy_fbs(format);
s->initialized = true;
@@ -747,25 +766,6 @@ static void create_fbs(enum pixel_format format)
LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_SPR, &s->scnd_spr);
}
-static void destroy_fbs(enum pixel_format format)
-{
- struct screen_fbs *s = &fbs[format];
-
- if (!s->initialized)
- return;
-
- if (scnd_mode_params.connector_id) {
- igt_remove_fb(drm.fd, &s->scnd_pri);
- igt_remove_fb(drm.fd, &s->scnd_cur);
- igt_remove_fb(drm.fd, &s->scnd_spr);
- }
- igt_remove_fb(drm.fd, &s->prim_pri);
- igt_remove_fb(drm.fd, &s->prim_cur);
- igt_remove_fb(drm.fd, &s->prim_spr);
- igt_remove_fb(drm.fd, &s->offscreen);
- igt_remove_fb(drm.fd, &s->big);
-}
-
static bool set_mode_for_params(struct modeset_params *params)
{
int rc;