radeon: use asic id table to get chipset name
PATCH 2/2 radeon: use asic id table to get chipset name
--- radeon/Makefile.am | 6 +++ radeon/Makefile.sources | 6 ++- radeon/radeon_asic_id.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ radeon/radeon_asic_id.h | 37 +++++++++++++++++ 4 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 radeon/radeon_asic_id.c create mode 100644 radeon/radeon_asic_id.h
radeon/Makefile.am +6 -0
@@ -30,6 +30,12 @@ AM_CFLAGS = \ $(PTHREADSTUBS_CFLAGS) \ -I$(top_srcdir)/include/drm +libdrmdatadir = @libdrmdatadir@ +ASIC_ID_TABLE_NUM_ENTRIES := $(shell egrep -ci '^[0-9a-f]{4},.*[0-9a-f]+,' \ + $(top_srcdir)/data/amdgpu.ids) +AM_CPPFLAGS = -DRADEON_ASIC_ID_TABLE=\"${libdrmdatadir}/amdgpu.ids\" \ + -DRADEON_ASIC_ID_TABLE_NUM_ENTRIES=$(ASIC_ID_TABLE_NUM_ENTRIES) + libdrm_radeon_la_LTLIBRARIES = libdrm_radeon.la libdrm_radeon_ladir = $(libdir) libdrm_radeon_la_LDFLAGS = -version-number 1:0:1 -no-undefined
radeon/Makefile.sources +4 -2
@@ -4,7 +4,8 @@ LIBDRM_RADEON_FILES := \ radeon_cs_space.c \ radeon_bo.c \ radeon_cs.c \ - radeon_surface.c + radeon_surface.c \ + radeon_asic_id.c LIBDRM_RADEON_H_FILES := \ radeon_bo.h \
@@ -14,7 +15,8 @@ LIBDRM_RADEON_H_FILES := \ radeon_cs_gem.h \ radeon_bo_int.h \ radeon_cs_int.h \ - r600_pci_ids.h + r600_pci_ids.h \ + radeon_asic_id.h LIBDRM_RADEON_BOF_FILES := \ bof.c \
radeon/radeon_asic_id.c new file +106 -0
106 lines not on this page · raw message
radeon/radeon_asic_id.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Copyright 2017 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +/** +* \file radeon_asic_id.h +* +* Declare public API for chipset name lookup +* +*/ +#ifndef _RADEON_ASIC_ID_H_ +#define _RADEON_ASIC_ID_H_ + +int radeon_asic_id_initialize (void ); +void radeon_asic_id_deinitialize (void ); +const char *radeon_get_marketing_name (uint32_t device_id,uint32_t pci_rev_id); + +#endif
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1498850702-13331-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org
Hi Sam,
do you also have a Mesa patch showing how the new APIs will be used? Without seeing that, some minor comments below.
radeon/radeon_asic_id.c line 37
Quoted 3 lines · Samuel Li
radeon/radeon_asic_id.c new file +2
-0+//#include <errno.h> +//#include <string.h>
Remove these lines.
Quoted 1 line
+#include "
util/util_asic_id.h"
Patch 1 adds the util directory to include paths, which would allow just
#include "util_asic_id.h"
Please consistently either use this, or don't add the util directory to the include path anywhere.
radeon/radeon_asic_id.c line 56
Quoted 4 lines
radeon/radeon_asic_id.c new file +4
-0+int radeon_asic_id_initialize (void ) +{ +int r =0 ; +pthread_mutex_lock (&asic_id_mutex);
Put an empty line between declarations and statements.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 9adcfdd9-9a6c-9077-a7ca-947af8b2a286-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 1 line
do you also have a Mesa patch showing how the new APIs will be used?
Sent out to mesa dev just now.
Quoted 1 line
Remove these lines.
Right.
Quoted 2 lines
Please consistently either use this, or don't add the util directory to the include path anywhere.
OK.
Quoted 1 line
Put an empty line between declarations and statements.
OK.
Sam
Quoted 41 lines
-----Original Message-----
From: Michel Dänzer [mailto:[email protected]]
Sent: Tuesday, July 04, 2017 5:43 AM
To: Li, Samuel <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH libdrm 2/2] radeon: use asic id table to get chipset nameHi Sam,
do you also have a Mesa patch showing how the new APIs will be used? Without seeing that, some minor comments below.
radeon/radeon_asic_id.c line 37
Quoted 3 lines · Samuel Li
radeon/radeon_asic_id.c new file +2
-0+//#include <errno.h> +//#include <string.h> Remove these lines.
Quoted 1 line
+#include "
util/util_asic_id.h"Patch 1 adds the util directory to include paths, which would allow just
#include "
util_asic_id.h"Please consistently either use this, or don't add the util directory to the include path anywhere.
radeon/radeon_asic_id.c line 56
Quoted 4 lines
radeon/radeon_asic_id.c new file +4
-0+int radeon_asic_id_initialize (void ) +{ +int r =0 ; +pthread_mutex_lock (&asic_id_mutex);Put an empty line between declarations and statements.
Quoted 3 lines
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Hi Samuel,
Quoted 16 lines · Samuel Li
Change-Id I24b6624789d1a9dc0fd3a446b0e6f21ed5183ff2Signed-off-by Samuel Li <[email protected]>--- radeon/Makefile.am | 6 +++ radeon/Makefile.sources | 6 ++- radeon/radeon_asic_id.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ radeon/radeon_asic_id.h | 37 +++++++++++++++++ 4 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 radeon/radeon_asic_id.c create mode 100644 radeon/radeon_asic_id.hradeon/Makefile.am +0
-0
radeon/Makefile.am AM_CFLAGS = \ · line 38
Quoted 9 lines
radeon/Makefile.am +6
-0@@ -30,6 +30,12 @@ AM_CFLAGS = \ $(PTHREADSTUBS_CFLAGS) \ -I$(top_srcdir)/include/drm +libdrmdatadir = @libdrmdatadir@ +ASIC_ID_TABLE_NUM_ENTRIES := $(shell egrep -ci '^[0-9a-f]{4},.*[0-9a-f]+,' \ + $(top_srcdir)/data/amdgpu.ids) +AM_CPPFLAGS = -DRADEON_ASIC_ID_TABLE=\"${libdrmdatadir}/amdgpu.ids\" \ + -DRADEON_ASIC_ID_TABLE_NUM_ENTRIES=$(ASIC_ID_TABLE_NUM_ENTRIES) +
Reusing amdgpu.ids by libdrm_radeon is not so obvious. I'm wondering if adding a comment in the file [amdgpu.ids] may be a good idea. "File is used by $LIST" or "File has multiple users" or anything that hints/makes people look up the details.
Couple of other ideas/suggestions:
- above all, as-is make check will fail
- keeping the radeon API symmetrical to the amdgpu one would a good idea
- is adding yet another header really justified?
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 1 line
- above all, as-is make check will fail
Right, I did not check that.
Quoted 1 line
- keeping the radeon API symmetrical to the amdgpu one would a good idea
The issue is Radeon does not have a struct similar to amdgpu_device_handle.
I think the current radeon API is simpler. Maybe a follow up change can change amdgpu's API similar to radeon.
Quoted 1 line
- is adding yet another header really justified?
radeon_asic_id.h? That is going to be used by ddx/mesa.
Sam
Quoted 46 lines
-----Original Message-----
From: Emil Velikov [mailto:[email protected]]
Sent: Wednesday, July 05, 2017 7:03 AM
To: Li, Samuel <[email protected]>
Cc: amd-gfx mailing list <[email protected]>; ML dri-devel <dri- [email protected]>
Subject: Re: [PATCH libdrm 2/2] radeon: use asic id table to get chipset nameHi Samuel,
Quoted 17 lines · Samuel Li
Change-Id I24b6624789d1a9dc0fd3a446b0e6f21ed5183ff2Signed-off-by Samuel Li <[email protected]>--- radeon/Makefile.am | 6 +++ radeon/Makefile.sources | 6 ++- radeon/radeon_asic_id.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ radeon/radeon_asic_id.h | 37 +++++++++++++++++ 4 files changed, 153 insertions(+), 2 deletions(-) create mode100644
radeon/radeon_asic_id.ccreate mode 100644radeon/radeon_asic_id.hradeon/Makefile.am index renamed from radeon/Makefile.am +0
-0e241531..69407bc 100644
radeon/Makefile.am AM_CFLAGS = \ · line 34
Quoted 5 lines
radeon/Makefile.am +2
-0@@ -30,6 +30,12 @@ AM_CFLAGS = \ $(PTHREADSTUBS_CFLAGS) \ -I$(top_srcdir)/include/drm +libdrmdatadir = @libdrmdatadir@ +ASIC_ID_TABLE_NUM_ENTRIES := $(shell egrep -ci '^[0-9a-f]{4},.*[0-9a-f]+,' \
radeon/Makefile.am AM_CFLAGS = \ · line 38
Quoted 4 lines
radeon/Makefile.am +4
-0+ $(top_srcdir)/data/amdgpu.ids) AM_CPPFLAGS = +-DRADEON_ASIC_ID_TABLE=\"${libdrmdatadir}/amdgpu.ids\" \ + +-DRADEON_ASIC_ID_TABLE_NUM_ENTRIES=$(ASIC_ID_TABLE_NUM_ENTRIE
S)radeon/Makefile.am AM_CFLAGS = \ · line 39
Quoted 1 line
radeon/Makefile.am +1
-0+Reusing amdgpu.ids by
libdrm_radeonis not so obvious. I'm wondering if adding a comment in the file [amdgpu.ids] may be a good idea. "File is used by $LIST" or "File has multiple users" or anything that hints/makes people look up the details.
Quoted 6 lines
Couple of other ideas/suggestions:
- above all, as-is make check will fail
- keeping the radeon API symmetrical to the amdgpu one would a good idea
- is adding yet another header really justified?-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
A message that is not in the archive (sent off-list or not yet received): BLUPR12MB0628623A3972B7F2BB1F69A7F5D40-7LeqcoF/[email protected]
Quoted 5 lines · Samuel
Quoted 1 line
- above all, as-is make check will fail
Right, I did not check that.
Quoted 1 line
- keeping the radeon API symmetrical to the amdgpu one would a good idea
The issue is Radeon does not have a struct similar to
amdgpu_device_handle.
Attach it to analogous primitive?
Quoted 2 lines
I think the current radeon API is simpler. Maybe a follow up change can change amdgpu's API similar to radeon.
Exposing 3 entry points instead of 1 is _not_simpler. Also you cannot change the existing API, since it also breaks the ABI. Leading to crash/cause memory corruption when using existing binaries.
Quoted 3 lines
Quoted 1 line
- is adding yet another header really justified?
radeon_asic_id.h? That is going to be used by ddx/mesa.
Where it's used is orthogonal. You don't need a separate _public_ header for nearly every entry point ;-)
Thanks
Emil
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): CACvgo514x_TAaaESizA10eUQFhUQr6DuWOB_B84i363Pqvk5Xg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 9 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Emil Velikov
Sent: Thursday, July 06, 2017 5:21 AM
To: Li, Samuel
Cc: ML dri-devel; amd-gfx mailing list
Subject: Re: [PATCH libdrm 2/2] radeon: use asic id table to get chipset nameOn 5 July 2017 at 22:31, Li, Samuel <[email protected]> wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
- above all, as-is make check will fail
Right, I did not check that.
Quoted 1 line
- keeping the radeon API symmetrical to the amdgpu one would a good
idea
Quoted 1 line
The issue is Radeon does not have a struct similar to
amdgpu_device_handle.
Attach it to analogous primitive?
Radeon libdrm is much different than amdgpu. There is no analog.
Quoted 8 lines
Quoted 2 lines
I think the current radeon API is simpler. Maybe a follow up change can
change amdgpu's API similar to radeon.
Quoted 1 line
Exposing 3 entry points instead of 1 is
_not_simpler. Also you cannot change the existing API, since it also breaks the ABI. Leading to crash/cause memory corruption when using existing binaries.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
- is adding yet another header really justified?
radeon_asic_id.h? That is going to be used by ddx/mesa.Where it's used is orthogonal. You don't need a separate _public_ header for nearly every entry point ;-)
Actually having a separate header makes sense for radeon. We currently expose a separate header for each set of functionality (one for buffer management, one for command submission, one for surface management). Adding the asic names to any of the existing ones doesn’t really make sense from a functional standpoint.
Alex
Quoted 7 lines
Thanks
Emil
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BN6PR12MB165270A0D5A5176AED04C472F7D50-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 4 lines · Alexander
Quoted 1 line
Attach it to analogous primitive?
Radeon libdrm is much different than amdgpu. There is no analog.
Upon a closer look, indeed there isn't. Must have gotten confused earlier.
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
I think the current radeon API is simpler. Maybe a follow up change can
change amdgpu's API similar to radeon.
Quoted 1 line
Exposing 3 entry points instead of 1 is
_not_simpler. Also you cannot change the existing API, since it also breaks the ABI. Leading to crash/cause memory corruption when using existing binaries.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
- is adding yet another header really justified?
radeon_asic_id.h? That is going to be used by ddx/mesa.Where it's used is orthogonal. You don't need a separate _public_ header for nearly every entry point ;-)
Actually having a separate header makes sense for radeon. We currently expose a separate header for each set of functionality (one for buffer management, one for command submission, one for surface management). Adding the asic names to any of the existing ones doesn’t really make sense from a functional standpoint.
Seems a bit unfortunate, but you have a point.
Having three extra entry points seems a bit much, but it seems like the best one can do atm.
Thanks
Emil
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx