dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: Magali Lemes <magalilemes00@gmail.com>
Cc: "André Almeida" <andrealmeid@igalia.com>,
	siqueirajordao@riseup.net, sunpeng.li@amd.com,
	tales.aparecida@gmail.com, airlied@linux.ie, Xinhui.Pan@amd.com,
	Rodrigo.Siqueira@amd.com, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, mairacanal@riseup.net,
	dri-devel@lists.freedesktop.org, alexander.deucher@amd.com,
	isabbasso@riseup.net, andrealmeid@riseup.net,
	christian.koenig@amd.com
Subject: Re: [PATCH 1/2] drm/amd/display: change variables type
Date: Tue, 26 Jul 2022 23:11:44 -0100	[thread overview]
Message-ID: <20220727001124.dsulur5hhlinjg6o@mail.igalia.com> (raw)
In-Reply-To: <88ce4703-e295-f41a-5905-d8afe5589f80@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4376 bytes --]

On 07/26, Magali Lemes wrote:
> On 7/25/22 20:38, Melissa Wen wrote:
> 
> > On 07/25, Magali Lemes wrote:
> > > On 7/25/22 16:42, André Almeida wrote:
> > > > Hi Magali,
> > > > 
> > > > Às 15:15 de 25/07/22, Magali Lemes escreveu:
> > > > > As "dcn3_15_soc" and "dcn3_16_soc" are of type "struct
> > > > > _vcs_dpi_soc_bounding_box_st", change their types accordingly.
> > > > > 
> > > > I can see that indeed this type change sense for those variables, but
> > > > isn't a bit strange that the type was wrong in the first place? I wonder
> > > > if this variable is even used, given that it would very likely throw a
> > > > compiler error when using the wrong type and trying to access struct
> > > > members that aren't defined.
> > > 
> > > A compilation error would be thrown if either "dc/dcn315/dcn315_resource.h"
> > > or "dc/dcn316/dcn316_resource.h" were included in the files where
> > > "dcn3_15_soc" and "dcn3_16_soc" are initialized. Since they are not
> > > included, the wrong variable type error is not shown.
> > > To solve the sparse warning in the second patch of this series, those
> > > variables need to be declared first, but they are already declared, we're
> > > only missing the headers. If I only add the headers, then those variables
> > > will be seen, and I get the expected incompatible variables types error. So,
> > > fixing the types here is a preliminary work for the next patch.
> > > 
> > Hi Magali,
> > 
> > Thanks for inspecting it. What you say makes sense, but André pointed
> > out something that makes sense to me too.
> > 
> > As fas as I checked, dcn3_15_soc and dcn16_soc is not used outside their
> > respective FPU files. Maybe the proper solution is removing those
> > declarations (and make the struct static). Can you take a look at it?
> > 
> > Best Regards,
> > 
> > Melissa
> 
> Hi, Melissa. Thank you for the suggestion!
> My sole reason not to make those structs static was to keep some sort of
> consistency with the rest of the dcn*_resource.h files, since that is where
> all the other structs are first declared. I'm not sure, though, if that's a
> good enough reason not to turn these variables into static. Let me know what
> you think.

I don't see any other file using dcn3_15_soc, it's only in dcn30_fpu, so
better make it static. Also, I see that doing this will ring a bell
for some misuse of the struct outside FPU protection, in the future.

With those points addressed, you can add in the next version:

Reviewed-by: Melissa Wen <mwen@igalia.com>

Thanks,

Melissa

> 
> Magali
> 
> 
> 
> > Magali
> > 
> > 
> > > > > Signed-off-by: Magali Lemes <magalilemes00@gmail.com>
> > > > > ---
> > > > >    drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h | 2 +-
> > > > >    drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.h | 2 +-
> > > > >    2 files changed, 2 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h b/drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h
> > > > > index 39929fa67a51..45276317c057 100644
> > > > > --- a/drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h
> > > > > +++ b/drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h
> > > > > @@ -32,7 +32,7 @@
> > > > >    	container_of(pool, struct dcn315_resource_pool, base)
> > > > >    extern struct _vcs_dpi_ip_params_st dcn3_15_ip;
> > > > > -extern struct _vcs_dpi_ip_params_st dcn3_15_soc;
> > > > > +extern struct _vcs_dpi_soc_bounding_box_st dcn3_15_soc;
> > > > >    struct dcn315_resource_pool {
> > > > >    	struct resource_pool base;
> > > > > diff --git a/drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.h b/drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.h
> > > > > index 0dc5a6c13ae7..d2234aac5449 100644
> > > > > --- a/drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.h
> > > > > +++ b/drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.h
> > > > > @@ -32,7 +32,7 @@
> > > > >    	container_of(pool, struct dcn316_resource_pool, base)
> > > > >    extern struct _vcs_dpi_ip_params_st dcn3_16_ip;
> > > > > -extern struct _vcs_dpi_ip_params_st dcn3_16_soc;
> > > > > +extern struct _vcs_dpi_soc_bounding_box_st dcn3_16_soc;
> > > > >    struct dcn316_resource_pool {
> > > > >    	struct resource_pool base;

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-07-27  0:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 18:15 [PATCH 1/2] drm/amd/display: change variables type Magali Lemes
2022-07-25 18:15 ` [PATCH 2/2] drm/amd/display: include missing headers Magali Lemes
2022-07-25 23:58   ` Melissa Wen
2022-07-25 19:42 ` [PATCH 1/2] drm/amd/display: change variables type André Almeida
2022-07-25 20:47   ` Magali Lemes
2022-07-25 23:38     ` Melissa Wen
2022-07-26 12:06       ` Magali Lemes
2022-07-27  0:11         ` Melissa Wen [this message]
2022-07-26 20:09     ` André Almeida
2022-07-25 21:18 ` Maíra Canal

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=20220727001124.dsulur5hhlinjg6o@mail.igalia.com \
    --to=mwen@igalia.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrealmeid@igalia.com \
    --cc=andrealmeid@riseup.net \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=isabbasso@riseup.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magalilemes00@gmail.com \
    --cc=mairacanal@riseup.net \
    --cc=siqueirajordao@riseup.net \
    --cc=sunpeng.li@amd.com \
    --cc=tales.aparecida@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).