From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9C64C10DCE for ; Thu, 12 Mar 2020 10:19:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDFC020674 for ; Thu, 12 Mar 2020 10:19:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDFC020674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 332A06E10F; Thu, 12 Mar 2020 10:19:12 +0000 (UTC) Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id E44AF6E10F for ; Thu, 12 Mar 2020 10:19:10 +0000 (UTC) Received: by mail-vs1-f67.google.com with SMTP id n6so3318924vsc.3 for ; Thu, 12 Mar 2020 03:19:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=84eImwNp3wL3WQtt/72ynKxZGySuG4GdHQohMcPIuBg=; b=WtYpTjKr9HN6uyLDh9+hqoE0WOo/N8OpBMrjexeCDC386lbTKpGagrB4kXMG2SeONk 0TpP29YpBK7HiLqNA/q/1yRmfANz/blKLRc8YVqjDPUuWtCGVl8QzBXIYA/4gt2lJ2Zi dD11qVSVUvvFO/OaICDJmDzeceXEj91HDNtz/bMWXrL2JBzQbU61m82daaxKNFQtWQ0o k8eLHx2f7RBaAhgusrMgTIo87Grbz9+TixFW3dCGTLYlvIlXL7uPOXEec3u29DJKJxip X08B8cTrbb9oTKvRf6C7wq/66g2PAHVIg/pVJpxa4DB5QKA8pVBGd9b1Aoz7+iMBB7qh W3UQ== X-Gm-Message-State: ANhLgQ3qgd5jP2SpvoMz0xaXc0hrU2vNpu0ZQRGB4EYMsiUJqVgUEn4Q 4WgDC4ZcphF2yt6rJH/hk1C9UZZjZnEIDwqLUiY= X-Google-Smtp-Source: ADFU+vuPhiO/vI34zo+JL9DUKXe6kJ9wrpQpgZjfLMQTBql5jqv6n3fBi1bPO7RHsUhEgYKKqq0Y0MpQOt2x9EeJFr4= X-Received: by 2002:a67:a409:: with SMTP id n9mr4974630vse.18.1584008350047; Thu, 12 Mar 2020 03:19:10 -0700 (PDT) MIME-Version: 1.0 References: <1582623496-6094-1-git-send-email-rohit.visavalia@xilinx.com> In-Reply-To: From: Ilia Mirkin Date: Thu, 12 Mar 2020 06:18:53 -0400 Message-ID: Subject: Re: [PATCH libdrm] modetest: call drmModeCrtcSetGamma() only if add_property_optional returns true To: Rohit Visavalia X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ranganathan Sk , Dhaval Rajeshbhai Shah , dri-devel , Varunkumar Allagadapa , Devarsh Thakkar , "emil.velikov@collabora.com" Content-Type: multipart/mixed; boundary="===============0921836261==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============0921836261== Content-Type: multipart/alternative; boundary="00000000000006a0e905a0a5af53" --00000000000006a0e905a0a5af53 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hm. I'm not sure offhand how to check if drmModeCrtcSetGamma is supported. I guess you could check if gamma size > 0 or something? On Thu, Mar 12, 2020, 02:39 Rohit Visavalia wrote: > Hi Ilia Mirkin, > > Thanks for the review. > > By old-fashioned way you mean to say using drmModeCrtcSetGamma()? If yes > then, it shows error as "failed to set gamma: Function no implemented" if > any platform specific drm has no gamma property implemented. > > Current code shows error while running modetest for Xilinx drm as it > doesn't supports gamma property and ideally it should not show error as > gamma is optional property, so it doesn't serve the purpose of optional > property. > > Please correct me if I am missing anything. > > Thanks > Rohit > > > -----Original Message----- > > From: Ilia Mirkin [mailto:imirkin@alum.mit.edu] > > Sent: Tuesday, March 3, 2020 7:08 PM > > To: Devarsh Thakkar > > Cc: Rohit Visavalia ; > dri-devel@lists.freedesktop.org; > > emil.velikov@collabora.com; Ville Syrj=C3=A4l=C3=A4 ; > Hyun > > Kwon ; Ranganathan Sk ; Dhaval > > Rajeshbhai Shah ; Varunkumar Allagadapa > > > > Subject: Re: [PATCH libdrm] modetest: call drmModeCrtcSetGamma() only i= f > > add_property_optional returns true > > > > EXTERNAL EMAIL > > > > Pretty sure the current code is right. If the GAMMA_LUT property can't > be set, > > it tries to set gamma the old-fashioned way. > > > > On Tue, Mar 3, 2020 at 8:12 AM Devarsh Thakkar > > wrote: > > > > > > Hi Rohit, > > > > > > This makes sense to me as gamma was implemented as optional property. > > > Reviewed-By: "Devarsh Thakkar " > > > > > > @emil.velikov@collabora.com, @imirkin@alum.mit.edu, @Ville Syrj=C3=A4= l=C3=A4, > > Could you please ack and help merge this patch if it also look good to > you ? > > > > > > Regards, > > > Devarsh > > > > > > > -----Original Message----- > > > > From: Rohit Visavalia > > > > Sent: 27 February 2020 00:40 > > > > To: Rohit Visavalia ; > > > > dri-devel@lists.freedesktop.org; imirkin@alum.mit.edu; > > > > emil.velikov@collabora.com > > > > Cc: Hyun Kwon ; Ranganathan Sk ; > > > > Dhaval Rajeshbhai Shah ; Varunkumar Allagadapa > > > > ; Devarsh Thakkar > > > > Subject: RE: [PATCH libdrm] modetest: call drmModeCrtcSetGamma() > > > > only if add_property_optional returns true > > > > > > > > Gentle reminder. > > > > > > > > + Ilia Mirkin, +Emil Velikov. > > > > > > > > Thanks & Regards, > > > > Rohit > > > > > > > > > -----Original Message----- > > > > > From: Rohit Visavalia [mailto:rohit.visavalia@xilinx.com] > > > > > Sent: Tuesday, February 25, 2020 3:08 PM > > > > > To: dri-devel@lists.freedesktop.org > > > > > Cc: Hyun Kwon ; Ranganathan Sk = ; > > > > > Dhaval Rajeshbhai Shah ; Varunkumar Allagadapa > > > > > ; Devarsh Thakkar ; > > > > > Rohit Visavalia > > > > > Subject: [PATCH libdrm] modetest: call drmModeCrtcSetGamma() only > > > > > if add_property_optional returns true > > > > > > > > > > gamma is a optional property then also it prints error message, s= o > > > > > set gamma only if add_property_optional() returns true. > > > > > > > > > > Signed-off-by: Rohit Visavalia > > > > > --- > > > > > tests/modetest/modetest.c | 2 +- > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.= c > > > > > index b907ab3..379b9ea 100644 > > > > > --- a/tests/modetest/modetest.c > > > > > +++ b/tests/modetest/modetest.c > > > > > @@ -1138,7 +1138,7 @@ static void set_gamma(struct device *dev, > > > > > unsigned crtc_id, unsigned fourcc) > > > > > > > > > > add_property_optional(dev, crtc_id, "DEGAMMA_LUT", 0); > > > > > add_property_optional(dev, crtc_id, "CTM", 0); > > > > > - if (!add_property_optional(dev, crtc_id, "GAMMA_LUT", > blob_id)) { > > > > > + if (add_property_optional(dev, crtc_id, "GAMMA_LUT", blob_id)= ) > > > > > + { > > > > > uint16_t r[256], g[256], b[256]; > > > > > > > > > > for (i =3D 0; i < 256; i++) { > > > > > -- > > > > > 2.7.4 > > > > --00000000000006a0e905a0a5af53 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hm. I'm not sure offhand how to check if=C2=A0drmMode= CrtcSetGamma is supported. I guess you could check if gamma size > 0 or = something?

On Thu, Mar 12, 2020, 02:39 Rohit Visavalia <RVISAVAL@xilinx.com> wrote:
Hi Ilia Mirkin,

Thanks for the review.

By old-fashioned way you mean to say using drmModeCrtcSetGamma()? If yes th= en, it shows error as "failed to set gamma: Function no implemented&qu= ot; if any platform specific drm has no gamma property implemented.

Current code shows error while running modetest for Xilinx drm as it doesn&= #39;t supports gamma property and ideally it should not show error as gamma= is optional property, so it doesn't serve the purpose of optional prop= erty.

Please correct me if I am missing anything.

Thanks
Rohit

> -----Original Message-----
> From: Ilia Mirkin [mailto:imirkin@alum.mit.edu]
> Sent: Tuesday, March 3, 2020 7:08 PM
> To: Devarsh Thakkar <DEVARSHT@xilinx.com>
> Cc: Rohit Visavalia <RVISAVAL@xilinx.com>; dr= i-devel@lists.freedesktop.org;
> emil.velikov@collabora.com; Ville Syrj=C3=A4l=C3=A4 <ville.syrjala@linux.intel.com>; Hyun
> Kwon <hyunk@xilinx.com>; Ranganathan Sk <rsk@xilinx.com>= ; Dhaval
> Rajeshbhai Shah <dshah@xilinx.com>; Varunkumar Allagadapa
> <VARUNKUM@xilinx.com>
> Subject: Re: [PATCH libdrm] modetest: call drmModeCrtcSetGamma() only = if
> add_property_optional returns true
>
> EXTERNAL EMAIL
>
> Pretty sure the current code is right. If the GAMMA_LUT property can&#= 39;t be set,
> it tries to set gamma the old-fashioned way.
>
> On Tue, Mar 3, 2020 at 8:12 AM Devarsh Thakkar <DEVARSHT@xilinx.co= m>
> wrote:
> >
> > Hi Rohit,
> >
> > This makes sense to me as gamma was implemented as optional prope= rty.
> > Reviewed-By: "Devarsh Thakkar <devarsh.thakkar@xi= linx.com>"
> >
> > @emil.velikov@collabora.com, @imirkin@alum.mit.edu<= /a>, @Ville Syrj=C3=A4l=C3=A4,
> Could you please ack and help merge this patch if it also look good to= you ?
> >
> > Regards,
> > Devarsh
> >
> > > -----Original Message-----
> > > From: Rohit Visavalia
> > > Sent: 27 February 2020 00:40
> > > To: Rohit Visavalia <
RVISAVAL@xilinx.com>;
> > > dri-devel@lists.freedesktop.org; imirkin@= alum.mit.edu;
> > > emil.velikov@collabora.com
> > > Cc: Hyun Kwon <hyunk@xilinx.com>; Ranganathan Sk <= ;rsk= @xilinx.com>;
> > > Dhaval Rajeshbhai Shah <dshah@xilinx.com>; Varunkuma= r Allagadapa
> > > <VARUNKUM@xilinx.com>; Devarsh Thakkar <DEVAR= SHT@xilinx.com>
> > > Subject: RE: [PATCH libdrm] modetest: call drmModeCrtcSetGam= ma()
> > > only if add_property_optional returns true
> > >
> > > Gentle reminder.
> > >
> > > + Ilia Mirkin, +Emil Velikov.
> > >
> > > Thanks & Regards,
> > > Rohit
> > >
> > > > -----Original Message-----
> > > > From: Rohit Visavalia [mailto:rohit.visavalia@x= ilinx.com]
> > > > Sent: Tuesday, February 25, 2020 3:08 PM
> > > > To: dri-devel@lists.freedesktop.org > > > > Cc: Hyun Kwon <hyunk@xilinx.com>; Ranganathan S= k <rsk@xilinx.com>;
> > > > Dhaval Rajeshbhai Shah <dshah@xilinx.com>; Varu= nkumar Allagadapa
> > > > <VARUNKUM@xilinx.com>; Devarsh Thakkar <<= a href=3D"mailto:DEVARSHT@xilinx.com" target=3D"_blank" rel=3D"noreferrer">= DEVARSHT@xilinx.com>;
> > > > Rohit Visavalia <RVISAVAL@xilinx.com>
> > > > Subject: [PATCH libdrm] modetest: call drmModeCrtcSetGa= mma() only
> > > > if add_property_optional returns true
> > > >
> > > > gamma is a optional property then also it prints error = message, so
> > > > set gamma only if add_property_optional() returns true.=
> > > >
> > > > Signed-off-by: Rohit Visavalia <rohit.visava= lia@xilinx.com>
> > > > ---
> > > >=C2=A0 tests/modetest/modetest.c | 2 +-
> > > >=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/tests/modetest/modetest.c b/tests/modetest= /modetest.c
> > > > index b907ab3..379b9ea 100644
> > > > --- a/tests/modetest/modetest.c
> > > > +++ b/tests/modetest/modetest.c
> > > > @@ -1138,7 +1138,7 @@ static void set_gamma(struct devi= ce *dev,
> > > > unsigned crtc_id, unsigned fourcc)
> > > >
> > > >=C2=A0 =C2=A0 =C2=A0add_property_optional(dev, crtc_id, = "DEGAMMA_LUT", 0);
> > > >=C2=A0 =C2=A0 =C2=A0add_property_optional(dev, crtc_id, = "CTM", 0);
> > > > -=C2=A0 =C2=A0if (!add_property_optional(dev, crtc_id, = "GAMMA_LUT", blob_id)) {
> > > > +=C2=A0 =C2=A0if (add_property_optional(dev, crtc_id, &= quot;GAMMA_LUT", blob_id))
> > > > + {
> > > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uint16_t= r[256], g[256], b[256];
> > > >
> > > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i = =3D 0; i < 256; i++) {
> > > > --
> > > > 2.7.4
> >
--00000000000006a0e905a0a5af53-- --===============0921836261== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0921836261==--