From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 853AF6E969 for ; Fri, 31 Jan 2020 10:55:22 +0000 (UTC) Date: Fri, 31 Jan 2020 12:55:20 +0200 From: Petri Latvala Message-ID: <20200131105520.GY25209@platvala-desk.ger.corp.intel.com> References: <20200131092603.24223-1-mika.kahola@intel.com> <20200131092603.24223-2-mika.kahola@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200131092603.24223-2-mika.kahola@intel.com> Subject: Re: [igt-dev] [PATCH i-g-t v2 1/1] tests/kms_plane_lowres: Fix CRC mismatch List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Mika Kahola Cc: igt-dev@lists.freedesktop.org List-ID: On Fri, Jan 31, 2020 at 11:26:03AM +0200, Mika Kahola wrote: > Mixing SDR and HDR planes yields to CRC mismatch. The patch computes the > reference image and CRC with the main plane matching the SDR/HDR plane type. > > v2: HDR planes are not defined for gen9 and older (CI) > > References: https://gitlab.freedesktop.org/drm/intel/issues/899 > Signed-off-by: Mika Kahola > --- > tests/kms_plane_lowres.c | 142 +++++++++++++++++++++++++-------------- > 1 file changed, 90 insertions(+), 52 deletions(-) > > diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c > index 4c3f5636..012b25e3 100644 > --- a/tests/kms_plane_lowres.c > +++ b/tests/kms_plane_lowres.c > @@ -32,11 +32,15 @@ > > IGT_TEST_DESCRIPTION("Test atomic mode setting with a plane by switching between high and low resolutions"); > > +#define SDR_PLANE_BASE 3 > #define SIZE 64 > > typedef struct { > int drm_fd; > igt_display_t display; > + uint32_t devid; > + igt_output_t *output; > + enum pipe pipe; > struct igt_fb fb_primary; > struct igt_fb fb_plane[2]; > struct { > @@ -77,11 +81,44 @@ get_lowres_mode(int drmfd, igt_output_t *output, > return *mode; > } > > +static igt_plane_t *first_sdr_plane(igt_output_t *output, uint32_t devid) > +{ > + int index; > + > + index = intel_gen(devid) <= 9 ? 0 : SDR_PLANE_BASE; > + > + return igt_output_get_plane(output, index); > +} > + > +static bool is_sdr_plane(const igt_plane_t *plane, uint32_t devid) > +{ > + if (intel_gen(devid) <= 9) > + return true; > + > + return plane->index >= SDR_PLANE_BASE; > +} kms_plane.c has similar HDR plane finder code by Ville. For some values of similar. At least it had comments explaining why the SDR plane base is 3. :P Any takers for refactoring to shared code? -- Petri Latvala _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev