Re: [1/4] amdgpu: add the function to get the marketing name (v2)
On 02/11/16 10:48 PM, Deucher, Alexander wrote: >> -Original Message- >> From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf >> Of Michel Dänzer >> Sent: Tuesday, November 01, 2016 11:51 PM >> To: Alex Deucher >> Cc: Zhang, Jerry; amd-gfx@lists.freedesktop.org >> Subject: Re: [1/4] amdgpu: add the function to get the marketing name (v2) >> >> On 01/11/16 06:34 PM, Michel Dänzer wrote: >>> On 13/09/16 12:14 AM, Alex Deucher wrote: From: Junwei ZhangThis function is used to look up the marking name for a specific board. v2: agd: Squash in subsequent updates to the table. >>> >>> As is, this breaks make check: >>> >>> +struct amdgpu_asic_id_table_t { >>> >>> Make this static, so the amdgpu_asic_id_table_t symbol doesn't get >>> exported from libdrm_amdgpu. >>> >>> BTW, is there any particular reason for putting this table in a separate >>> header file? >>> >>> @@ -303,3 +304,17 @@ int >> amdgpu_device_deinitialize(amdgpu_device_handle dev) amdgpu_device_reference(, NULL); return 0; } + +const char *amdgpu_get_marketing_name(amdgpu_device_handle >> dev) >>> >>> amdgpu_get_marketing_name needs to be added to amdgpu-symbols- >> check. >>> >>> + if ((t->did == dev->info.asic_id) && + (t->rid == dev->info.pci_rev_id)) >>> >>> Wrong indentation of the second line. >>> >>> >>> With these issues fixed, >>> >>> Reviewed-by: Michel Dänzer >>> >>> Would be nice to land this in master soon, as we're going to use it in >>> xf86-video-amdgpu: https://patchwork.freedesktop.org/patch/119501/ >> >> Junwei, if it's okay with you, I can amend the patch and push it to master. > > You might double check the internal git tree and pick up any additional > marketing names that were added since I pulled those patches. Done (no new entries have been added, but a few redundant ones have been removed), thanks. v3 patch submitted for review. -- 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
RE: [1/4] amdgpu: add the function to get the marketing name (v2)
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Michel Dänzer > Sent: Tuesday, November 01, 2016 11:51 PM > To: Alex Deucher > Cc: Zhang, Jerry; amd-gfx@lists.freedesktop.org > Subject: Re: [1/4] amdgpu: add the function to get the marketing name (v2) > > On 01/11/16 06:34 PM, Michel Dänzer wrote: > > On 13/09/16 12:14 AM, Alex Deucher wrote: > >> From: Junwei Zhang> >> > >> This function is used to look up the marking name > >> for a specific board. > >> > >> v2: agd: Squash in subsequent updates to the table. > > > > As is, this breaks make check: > > > > > >> +struct amdgpu_asic_id_table_t { > > > > Make this static, so the amdgpu_asic_id_table_t symbol doesn't get > > exported from libdrm_amdgpu. > > > > BTW, is there any particular reason for putting this table in a separate > > header file? > > > > > >> @@ -303,3 +304,17 @@ int > amdgpu_device_deinitialize(amdgpu_device_handle dev) > >>amdgpu_device_reference(, NULL); > >>return 0; > >> } > >> + > >> +const char *amdgpu_get_marketing_name(amdgpu_device_handle > dev) > > > > amdgpu_get_marketing_name needs to be added to amdgpu-symbols- > check. > > > > > >> + if ((t->did == dev->info.asic_id) && > >> + (t->rid == dev->info.pci_rev_id)) > > > > Wrong indentation of the second line. > > > > > > With these issues fixed, > > > > Reviewed-by: Michel Dänzer > > > > Would be nice to land this in master soon, as we're going to use it in > > xf86-video-amdgpu: https://patchwork.freedesktop.org/patch/119501/ > > Junwei, if it's okay with you, I can amend the patch and push it to master. You might double check the internal git tree and pick up any additional marketing names that were added since I pulled those patches. Alex > > > -- > 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 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [1/4] amdgpu: add the function to get the marketing name (v2)
On 01/11/16 06:34 PM, Michel Dänzer wrote: > On 13/09/16 12:14 AM, Alex Deucher wrote: >> From: Junwei Zhang>> >> This function is used to look up the marking name >> for a specific board. >> >> v2: agd: Squash in subsequent updates to the table. > > As is, this breaks make check: > > >> +struct amdgpu_asic_id_table_t { > > Make this static, so the amdgpu_asic_id_table_t symbol doesn't get > exported from libdrm_amdgpu. > > BTW, is there any particular reason for putting this table in a separate > header file? > > >> @@ -303,3 +304,17 @@ int amdgpu_device_deinitialize(amdgpu_device_handle dev) >> amdgpu_device_reference(, NULL); >> return 0; >> } >> + >> +const char *amdgpu_get_marketing_name(amdgpu_device_handle dev) > > amdgpu_get_marketing_name needs to be added to amdgpu-symbols-check. > > >> +if ((t->did == dev->info.asic_id) && >> +(t->rid == dev->info.pci_rev_id)) > > Wrong indentation of the second line. > > > With these issues fixed, > > Reviewed-by: Michel Dänzer > > Would be nice to land this in master soon, as we're going to use it in > xf86-video-amdgpu: https://patchwork.freedesktop.org/patch/119501/ Junwei, if it's okay with you, I can amend the patch and push it to master. -- 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
Re: [1/4] amdgpu: add the function to get the marketing name (v2)
On 13/09/16 12:14 AM, Alex Deucher wrote: > From: Junwei Zhang> > This function is used to look up the marking name > for a specific board. > > v2: agd: Squash in subsequent updates to the table. As is, this breaks make check: > +struct amdgpu_asic_id_table_t { Make this static, so the amdgpu_asic_id_table_t symbol doesn't get exported from libdrm_amdgpu. BTW, is there any particular reason for putting this table in a separate header file? > @@ -303,3 +304,17 @@ int amdgpu_device_deinitialize(amdgpu_device_handle dev) > amdgpu_device_reference(, NULL); > return 0; > } > + > +const char *amdgpu_get_marketing_name(amdgpu_device_handle dev) amdgpu_get_marketing_name needs to be added to amdgpu-symbols-check. > + if ((t->did == dev->info.asic_id) && > + (t->rid == dev->info.pci_rev_id)) Wrong indentation of the second line. With these issues fixed, Reviewed-by: Michel Dänzer Would be nice to land this in master soon, as we're going to use it in xf86-video-amdgpu: https://patchwork.freedesktop.org/patch/119501/ -- 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
[PATCH 1/4] amdgpu: add the function to get the marketing name (v2)
From: Junwei ZhangThis function is used to look up the marking name for a specific board. v2: agd: Squash in subsequent updates to the table. Signed-off-by: Junwei Zhang Reviewed-by: Flora Cui --- amdgpu/amdgpu.h | 10 +++ amdgpu/amdgpu_asic_id.h | 170 amdgpu/amdgpu_device.c | 15 + 3 files changed, 195 insertions(+) create mode 100644 amdgpu/amdgpu_asic_id.h diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index 5d5a2c6..7b26a04 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1245,4 +1245,14 @@ int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx, */ int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem); +/** + * Get the ASIC marketing name + * + * \param dev - \c [in] Device handle. See #amdgpu_device_initialize() + * + * \return the constant string of the marketing name + * "NULL" means the ASIC is not found +*/ +const char *amdgpu_get_marketing_name(amdgpu_device_handle dev); + #endif /* #ifdef _AMDGPU_H_ */ diff --git a/amdgpu/amdgpu_asic_id.h b/amdgpu/amdgpu_asic_id.h new file mode 100644 index 000..041ebe3 --- /dev/null +++ b/amdgpu/amdgpu_asic_id.h @@ -0,0 +1,170 @@ +/* + * Copyright © 2016 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * 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. + * + */ + +#ifndef __AMDGPU_ASIC_ID_H__ +#define __AMDGPU_ASIC_ID_H__ + +struct amdgpu_asic_id_table_t { + uint32_t did; + uint32_t rid; + char marketing_name[64]; +} const amdgpu_asic_id_table [] = { + {0x6600,0x0,"AMD Radeon HD 8600/8700M"}, + {0x6600,0x81, "AMD Radeon (TM) R7 M370"}, + {0x6601,0x0,"AMD Radeon (TM) HD 8500M/8700M"}, + {0x6604,0x0,"AMD Radeon R7 M265 Series"}, + {0x6604,0x81, "AMD Radeon (TM) R7 M350"}, + {0x6605,0x0,"AMD Radeon R7 M260 Series"}, + {0x6605,0x81, "AMD Radeon (TM) R7 M340"}, + {0x6606,0x0,"AMD Radeon HD 8790M"}, + {0x6607,0x0,"AMD Radeon (TM) HD8530M"}, + {0x6608,0x0,"AMD FirePro W2100"}, + {0x6610,0x0,"AMD Radeon HD 8600 Series"}, + {0x6610,0x81, "AMD Radeon (TM) R7 350"}, + {0x6610,0x83, "AMD Radeon (TM) R5 340"}, + {0x6611,0x0,"AMD Radeon HD 8500 Series"}, + {0x6613,0x0,"AMD Radeon HD 8500 series"}, + {0x6617,0xC7, "AMD Radeon R7 240 Series"}, + {0x6640,0x0,"AMD Radeon HD 8950"}, + {0x6640,0x80, "AMD Radeon (TM) R9 M380"}, + {0x6646,0x0,"AMD Radeon R9 M280X"}, + {0x6646,0x80, "AMD Radeon (TM) R9 M470X"}, + {0x6647,0x0,"AMD Radeon R9 M270X"}, + {0x6647,0x80, "AMD Radeon (TM) R9 M380"}, + {0x6649,0x0,"AMD FirePro W5100"}, + {0x6658,0x0,"AMD Radeon R7 200 Series"}, + {0x665C,0x0,"AMD Radeon HD 7700 Series"}, + {0x665D,0x0,"AMD Radeon R7 200 Series"}, + {0x665F,0x81, "AMD Radeon (TM) R7 300 Series"}, + {0x6660,0x0,"AMD Radeon HD 8600M Series"}, + {0x6660,0x81, "AMD Radeon (TM) R5 M335"}, + {0x6660,0x83, "AMD Radeon (TM) R5 M330"}, + {0x6663,0x0,"AMD Radeon HD 8500M Series"}, + {0x6663,0x83, "AMD Radeon (TM) R5 M320"}, + {0x6664,0x0,"AMD Radeon R5 M200 Series"}, + {0x6665,0x0,"AMD Radeon R5 M200 Series"}, + {0x6665,0x83, "AMD Radeon (TM) R5 M320"}, + {0x6667,0x0,"AMD Radeon R5 M200 Series"}, + {0x666F,0x0,"AMD Radeon HD 8500M"}, + {0x6780,0x0,"ATI FirePro V (FireGL V) Graphics Adapter"}, + {0x678A,