All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
To: "Li, Samuel" <Samuel.Li-5C7GfCeVMHo@public.gmane.org>
Cc: "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Yuan, Xiaojie" <Xiaojie.Yuan-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH libdrm v4 1/1] amdgpu: move asic id table to a separate file
Date: Wed, 31 May 2017 14:15:10 +0900	[thread overview]
Message-ID: <d4f0edae-8adf-50b1-e0b0-520b9e368e9c@daenzer.net> (raw)
In-Reply-To: <CY1PR1201MB1033195A941CEB02E9E93DB2F5F00-JBJ/M6OpXY+2VhmsawAdvGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>

On 31/05/17 07:31 AM, Li, Samuel wrote:
> From: Michel Dänzer [mailto:michel@daenzer.net] 
>> On 30/05/17 06:16 AM, Samuel Li wrote:
>> 
>>> diff --git a/amdgpu/amdgpu_asic_id.c b/amdgpu/amdgpu_asic_id.c new 
>>> file mode 100644 index 0000000..a43ca33
>>> --- /dev/null
>>> +++ b/amdgpu/amdgpu_asic_id.c
>> 
>> [...]
>> 
>>> +#include "xf86drm.h"
>>> +#include "amdgpu_drm.h"
>> 
>> Should be
>> 
>> #include <xf86drm.h>
>> #include <amdgpu_drm.h>
>> 
>> since these header files are not located in the same directory as
>> amdgpu_asic_id.c.
> 
>  [Sam] Actually, "" is used to include programmer-defined header files,
> and <>  is used for files pre-designated by the compiler/IDE.

The only difference between the two is that #include "" first looks for
the header file in the same directory where the file containing the
#include directive (not necessarily the same as the original *.c file
passed to the compiler/preprocessor) is located, after that it looks in
the same paths in the same order as <>. So "" only really makes sense
when the header file is in the same directory as the file including it.


>>> @@ -267,6 +274,11 @@ int amdgpu_device_initialize(int fd,
>>>  	amdgpu_vamgr_init(&dev->vamgr_32, start, max,
>>>  			  dev->dev_info.virtual_address_alignment);
>>>  
>>> +	r = amdgpu_parse_asic_ids(&dev->asic_ids);
>>> +	if (r)
>>> +		fprintf(stderr, "%s: Can not parse asic ids, 0x%x.",
>>> +			__func__, r);
>> 
>> "Cannot parse ASIC IDs"
>> 
>> Also, there should be curly braces around a multi-line statement.
> 
> [Sam] Can be done. However, it is still a single statement. Does it matter?

It might not be strictly required, but I think it does make the code
clearer in this case.


>>> diff --git a/include/drm/amdgpu.ids b/include/drm/amdgpu.ids
>>> new file mode 100644
>>> index 0000000..6d6b944
>>> --- /dev/null
>>> +++ b/include/drm/amdgpu.ids
>> 
>> I think the path of this file in the repository should be
>> amdgpu/amdgpu.ids rather than include/drm/amdgpu.ids.
> 
> [Sam] The file is going to be shared with radeon.

We can cross that bridge when we get there. Meanwhile, it's not a header
file and not installed under $prefix/include/, so it doesn't belong in
include/.


>>> @@ -0,0 +1,170 @@
>>> +# List of AMDGPU ID's
>> 
>> This should say "IDs" instead of "ID's".
>> 
>> 
>>> +67FF,	CF,	67FF:CF
>>> +67FF,	EF,	67FF:EF
>> 
>> There should be no such dummy entries in the file. If it's useful,
>> amdgpu_get_marketing_name can return a dummy string based on the PCI ID
>> and revision when there's no matching entry in the file.
> 
> [Sam] I forwarded another thread to you.

Please make your argument explicitly, for the benefit of non-AMD readers
of the amd-gfx list.

Anyway, I don't think that invalidates what I wrote, and Alex seems to
agree. "67FF:CF" isn't a marketing name, so there should be no such
entries in this file. It's not necessary anyway; assuming it's useful
for amdgpu_get_marketing_name to return such "names", it can generate
them on the fly when there is no matching entry in the file.

Ideally the issues above should be fixed in the original file we get
from marketing (?), but meanwhile / failing that we should fix them up
(and can easily with Git).


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-05-31  5:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 21:16 [PATCH libdrm v4 1/1] amdgpu: move asic id table to a separate file Samuel Li
     [not found] ` <1496092589-10642-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org>
2017-05-30  1:25   ` Michel Dänzer
     [not found]     ` <79a6b0a4-edb4-0368-1902-90458b577c1f-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-05-30 22:31       ` Li, Samuel
     [not found]         ` <CY1PR1201MB1033195A941CEB02E9E93DB2F5F00-JBJ/M6OpXY+2VhmsawAdvGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-05-31  5:15           ` Michel Dänzer [this message]
     [not found]             ` <d4f0edae-8adf-50b1-e0b0-520b9e368e9c-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-05-31 13:17               ` Alex Deucher
     [not found]                 ` <CADnq5_OZNgmVYeLyDBdzrvqLLKJ+EAKBq00K0WLFw+W1EnhgiQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-01  5:46                   ` Michel Dänzer
2017-05-31 15:32               ` Li, Samuel
     [not found]                 ` <CY1PR1201MB10336D98A57C23B8C3DF18A9F5F10-JBJ/M6OpXY+2VhmsawAdvGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-01  6:09                   ` Michel Dänzer
     [not found]                     ` <4cad0af4-94d0-0a74-7bfc-ef2e63227800-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-06-01 14:27                       ` Li, Samuel
     [not found]                         ` <CY1PR1201MB10333653ACF093A7C38341EEF5F60-JBJ/M6OpXY+2VhmsawAdvGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-02  3:05                           ` Michel Dänzer
     [not found]                             ` <b13d7f5c-85ea-aba2-bf1d-66d74f0a6e1b-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-06-02 14:25                               ` Li, Samuel

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=d4f0edae-8adf-50b1-e0b0-520b9e368e9c@daenzer.net \
    --to=michel-otuistvhuppr7s880joybq@public.gmane.org \
    --cc=Samuel.Li-5C7GfCeVMHo@public.gmane.org \
    --cc=Xiaojie.Yuan-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.