From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id A904010E1FD for ; Tue, 8 Aug 2023 16:56:09 +0000 (UTC) Message-ID: <37400473-1d0b-e001-c2c9-e306c63e52d8@quicinc.com> Date: Tue, 8 Aug 2023 09:55:59 -0700 MIME-Version: 1.0 Content-Language: en-US To: Rob Clark , References: <20230808145334.24277-1-robdclark@gmail.com> From: Abhinav Kumar In-Reply-To: <20230808145334.24277-1-robdclark@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [igt-dev] [PATCH 1/2] tests/kms_plane: Handle hw without legacy gamma support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 8/8/2023 7:53 AM, Rob Clark wrote: > From: Rob Clark > > Skip the legacy gamma on hw that doesn't support it, instead of failing. > The legacy LUT support was used to drop the precision down to 6 bits, to > paper over errors introduced y RGB<->YCbCr conversion, but this isn't > necessarily needed on all hw. > > v2: igt_require(lut_size > 0) instead > v3: simplify patch > > Signed-off-by: Rob Clark > Reviewed-by: Juha-Pekka Heikkila Reviewed-by: Abhinav Kumar Tested-by: Abhinav Kumar # sc7280 > --- > tests/kms_plane.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tests/kms_plane.c b/tests/kms_plane.c > index 67cff61d6cd1..a444cdca23e2 100644 > --- a/tests/kms_plane.c > +++ b/tests/kms_plane.c > @@ -469,6 +469,10 @@ static void set_legacy_lut(data_t *data, enum pipe pipe, > lut_size = crtc->gamma_size; > drmModeFreeCrtc(crtc); > > + /* Skip if legacy LUT is not supported: */ > + if (!lut_size) > + return; > + > lut = malloc(sizeof(uint16_t) * lut_size); > > for (i = 0; i < lut_size; i++)