Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9987910E3D7 for ; Thu, 13 Oct 2022 04:06:48 +0000 (UTC) Message-ID: Date: Thu, 13 Oct 2022 09:36:21 +0530 Content-Language: en-US To: Ananya Sharma , References: <20221012123446.30393-1-ananya.sharma@intel.com> <20221012123446.30393-2-ananya.sharma@intel.com> From: "Modem, Bhanuprakash" In-Reply-To: <20221012123446.30393-2-ananya.sharma@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Subject: Re: [igt-dev] [PATCH i-g-t 1/7] tests/kms_color_helper.c List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On Wed-12-10-2022 06:04 pm, Ananya Sharma wrote: > In this we are modifying the functions paint_rectangle() > paint_gradient_rectangle() by including x and y plane > coordinates to support multiplanes. Please follow some standard to write good commit message [1]. This comment is applicable for all the patches in this series. Also, the effected changes (who ever calling these helpers) also should be part of this patch. Example: If we apply this patch alone, it'll break the IGT compilation. [1]: https://cbea.ms/git-commit/ - Bhanu > > Signed-off-by: Ananya Sharma > --- > tests/kms_color_helper.c | 26 +++++++++++++++----------- > tests/kms_color_helper.h | 10 ++++++++-- > 2 files changed, 23 insertions(+), 13 deletions(-) > > diff --git a/tests/kms_color_helper.c b/tests/kms_color_helper.c > index 55f3e409..dbcb3f34 100644 > --- a/tests/kms_color_helper.c > +++ b/tests/kms_color_helper.c > @@ -41,20 +41,22 @@ uint64_t get_max_bpc(igt_output_t *output) > } > > void paint_gradient_rectangles(data_t *data, > - drmModeModeInfo *mode, > + uint16_t vdisplay, > + uint16_t hdisplay, > + int x, int y, > color_t *colors, > struct igt_fb *fb) > { > cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); > - int i, l = mode->hdisplay / 3; > - int rows_remaining = mode->hdisplay % 3; > + int i, l = hdisplay / 3; > + int rows_remaining = hdisplay % 3; > > /* Paint 3 gradient rectangles with red/green/blue between 1.0 and > * 0.5. We want to avoid 0 so each max LUTs only affect their own > * rectangle. > */ > for (i = 0 ; i < 3; i++) { > - igt_paint_color_gradient_range(cr, i * l, 0, l, mode->vdisplay, > + igt_paint_color_gradient_range(cr, (x + (i * l)), y, l, vdisplay, > colors[i].r != 0 ? 0.2 : 0, > colors[i].g != 0 ? 0.2 : 0, > colors[i].b != 0 ? 0.2 : 0, > @@ -64,8 +66,8 @@ void paint_gradient_rectangles(data_t *data, > } > > if (rows_remaining > 0) > - igt_paint_color_gradient_range(cr, i * l, 0, rows_remaining, > - mode->vdisplay, > + igt_paint_color_gradient_range(cr, (x + (i * l)), y, rows_remaining, > + vdisplay, > colors[i-1].r != 0 ? 0.2 : 0, > colors[i-1].g != 0 ? 0.2 : 0, > colors[i-1].b != 0 ? 0.2 : 0, > @@ -77,22 +79,24 @@ void paint_gradient_rectangles(data_t *data, > } > > void paint_rectangles(data_t *data, > - drmModeModeInfo *mode, > + uint16_t vdisplay, > + uint16_t hdisplay, > + int x, int y, > color_t *colors, > struct igt_fb *fb) > { > cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); > - int i, l = mode->hdisplay / 3; > - int rows_remaining = mode->hdisplay % 3; > + int i, l = hdisplay / 3; > + int rows_remaining = hdisplay % 3; > > /* Paint 3 solid rectangles. */ > for (i = 0 ; i < 3; i++) { > - igt_paint_color(cr, i * l, 0, l, mode->vdisplay, > + igt_paint_color(cr, (x + (i * l)), y, l, vdisplay, > colors[i].r, colors[i].g, colors[i].b); > } > > if (rows_remaining > 0) > - igt_paint_color(cr, i * l, 0, rows_remaining, mode->vdisplay, > + igt_paint_color(cr, (x + (i * l)), y, rows_remaining, vdisplay, > colors[i-1].r, colors[i-1].g, colors[i-1].b); > > igt_put_cairo_ctx(cr); > diff --git a/tests/kms_color_helper.h b/tests/kms_color_helper.h > index f0ae30e3..199d449c 100644 > --- a/tests/kms_color_helper.h > +++ b/tests/kms_color_helper.h > @@ -51,9 +51,11 @@ typedef struct { > igt_pipe_crc_t *pipe_crc; > igt_output_t *output; > igt_plane_t *primary; > + igt_plane_t *overlay; > drmModeModeInfo *mode; > > uint32_t drm_format; > + uint32_t drm_format_overlay; > uint32_t color_depth; > uint64_t degamma_lut_size; > uint64_t gamma_lut_size; > @@ -72,11 +74,15 @@ typedef struct { > bool panel_supports_deep_color(int fd, char *output_name); > uint64_t get_max_bpc(igt_output_t *output); > void paint_gradient_rectangles(data_t *data, > - drmModeModeInfo *mode, > + uint16_t vdisplay, > + uint16_t hdisplay, > + int x, int y, > color_t *colors, > struct igt_fb *fb); > void paint_rectangles(data_t *data, > - drmModeModeInfo *mode, > + uint16_t vdisplay, > + uint16_t hdisplay, > + int x, int y, > color_t *colors, > struct igt_fb *fb); > gamma_lut_t *alloc_lut(int lut_size);