From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 6/6] tests/kms_color: Make legacy-gamma-reset work with a partial color pipeline
Date: Tue, 2 Apr 2019 19:33:48 +0300 [thread overview]
Message-ID: <20190402163348.4680-6-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190402163348.4680-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
No reason why we shouldn't be able to execute the legacy-gamma-reset
test with a partial color pipeline.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tests/kms_color.c | 45 ++++++++++++++++++++++++++-------------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/tests/kms_color.c b/tests/kms_color.c
index fd4c9a6dd812..43126c79079d 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -557,19 +557,17 @@ static void test_pipe_legacy_gamma_reset(data_t *data,
0.0, 0.0, 1.0
};
drmModeCrtc *kms_crtc;
- gamma_lut_t *degamma_linear, *gamma_zero;
+ gamma_lut_t *degamma_linear = NULL, *gamma_zero;
uint32_t i, legacy_lut_size;
uint16_t *red_lut, *green_lut, *blue_lut;
struct drm_color_lut *lut;
drmModePropertyBlobPtr blob;
igt_output_t *output;
- /* FIXME accept any one of these */
- igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT));
igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT));
- igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_CTM));
- degamma_linear = generate_table(data->degamma_lut_size, 1.0);
+ if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT))
+ degamma_linear = generate_table(data->degamma_lut_size, 1.0);
gamma_zero = generate_table_zero(data->gamma_lut_size);
for_each_valid_output_on_pipe(&data->display, primary->pipe->pipe, output) {
@@ -584,21 +582,27 @@ static void test_pipe_legacy_gamma_reset(data_t *data,
/* Set a degama & gamma LUT and a CTM using the
* properties and verify the content of the
* properties. */
- set_degamma(data, primary->pipe, degamma_linear);
- set_ctm(primary->pipe, ctm_identity);
+ if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT))
+ set_degamma(data, primary->pipe, degamma_linear);
+ if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_CTM))
+ set_ctm(primary->pipe, ctm_identity);
set_gamma(data, primary->pipe, gamma_zero);
igt_display_commit(&data->display);
- blob = get_blob(data, primary->pipe, IGT_CRTC_DEGAMMA_LUT);
- igt_assert(blob &&
- blob->length == (sizeof(struct drm_color_lut) *
- data->degamma_lut_size));
- drmModeFreePropertyBlob(blob);
+ if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT)) {
+ blob = get_blob(data, primary->pipe, IGT_CRTC_DEGAMMA_LUT);
+ igt_assert(blob &&
+ blob->length == (sizeof(struct drm_color_lut) *
+ data->degamma_lut_size));
+ drmModeFreePropertyBlob(blob);
+ }
- blob = get_blob(data, primary->pipe, IGT_CRTC_CTM);
- igt_assert(blob &&
- blob->length == sizeof(struct drm_color_ctm));
- drmModeFreePropertyBlob(blob);
+ if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_CTM)) {
+ blob = get_blob(data, primary->pipe, IGT_CRTC_CTM);
+ igt_assert(blob &&
+ blob->length == sizeof(struct drm_color_ctm));
+ drmModeFreePropertyBlob(blob);
+ }
blob = get_blob(data, primary->pipe, IGT_CRTC_GAMMA_LUT);
igt_assert(blob &&
@@ -632,9 +636,12 @@ static void test_pipe_legacy_gamma_reset(data_t *data,
0);
igt_display_commit(&data->display);
- igt_assert(get_blob(data, primary->pipe,
- IGT_CRTC_DEGAMMA_LUT) == NULL);
- igt_assert(get_blob(data, primary->pipe, IGT_CRTC_CTM) == NULL);
+ if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT))
+ igt_assert(get_blob(data, primary->pipe,
+ IGT_CRTC_DEGAMMA_LUT) == NULL);
+
+ if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_CTM))
+ igt_assert(get_blob(data, primary->pipe, IGT_CRTC_CTM) == NULL);
blob = get_blob(data, primary->pipe, IGT_CRTC_GAMMA_LUT);
igt_assert(blob &&
--
2.19.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-04-02 16:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 16:33 [igt-dev] [PATCH i-g-t 1/6] tests/kms_color: Nuke local struct definitions Ville Syrjala
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 2/6] tests/kms_color: Wrap LUTs in a gamma_lut_t struct Ville Syrjala
2019-04-03 10:50 ` Daniel Vetter
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 3/6] tests/kms_color: Reuse some already compute values Ville Syrjala
2019-04-03 10:51 ` Daniel Vetter
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 4/6] tests/kms_color: Allow most subtests to run with a partial color pipeline Ville Syrjala
2019-04-03 13:50 ` Daniel Vetter
2019-04-03 14:22 ` Ville Syrjälä
2019-04-02 16:33 ` [igt-dev] [PATCH i-g-t 5/6] tests/kms_color: Split invalid_lut_sizes() into gamma vs. degamma versions Ville Syrjala
2019-04-03 13:52 ` Daniel Vetter
2019-04-03 14:20 ` Ville Syrjälä
2019-04-02 16:33 ` Ville Syrjala [this message]
2019-04-03 13:53 ` [igt-dev] [PATCH i-g-t 6/6] tests/kms_color: Make legacy-gamma-reset work with a partial color pipeline Daniel Vetter
2019-04-02 17:37 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/6] tests/kms_color: Nuke local struct definitions Patchwork
2019-04-03 6:33 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-03 8:40 ` [igt-dev] [PATCH i-g-t 1/6] " Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190402163348.4680-6-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox