summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdxcp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* drm/amd/amdxcp: Fix warningsLijo Lazar2024-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Range of possible values of pdev_num is 0-63. Use int8_t as data type. That also fixes below warnings: >> drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c:59:58: warning: '%d' >> directive output may be truncated writing between 1 and 11 bytes into >> a region of size 9 [-Wformat-truncation=] 59 | snprintf(dev_name, sizeof(dev_name), "amdgpu_xcp_%d", pdev_num); | ^~ drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c:59:46: note: directive argument in the range [-2147483648, 63] 59 | snprintf(dev_name, sizeof(dev_name), "amdgpu_xcp_%d", pdev_num); | ^~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdxcp/amdgpu_xcp_drv.c:59:9: note: 'snprintf' output between 13 and 23 bytes into a destination of size 20 59 | snprintf(dev_name, sizeof(dev_name), "amdgpu_xcp_%d", pdev_num); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 97d814fe4f69 ("drm/amd/amdxcp: Use unique name for partition dev") Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/amdxcp: Use unique name for partition devLijo Lazar2024-05-021-1/+3
| | | | | | | | | | | | | | | | | | | | amdxcp is a platform driver for creating partition devices. libdrm library identifies a platform device based on 'OF_FULLNAME' or 'MODALIAS'. If two or more devices have the same platform name, drm library only picks the first device. Platform driver core uses name of the device to populate 'MODALIAS'. When 'amdgpu_xcp' is used as the base name, only first partition device gets identified. Assign unique name so that drm library identifies partition devices separately. amdxcp doesn't support probe of partitions, it doesn't bother about modaliases. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: James Zhu <James.Zhu@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdxcp: fix amdxcp unloads incompletelyJames Zhu2023-10-271-3/+4
| | | | | | | | | | | | amdxcp unloads incompletely, and below error will be seen during load/unload, sysfs: cannot create duplicate filename '/devices/platform/amdgpu_xcp.0' devres_release_group will free xcp device at first, platform device will be unregistered later in platform_device_unregister. Signed-off-by: James Zhu <James.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdxcp: fix Makefile to build amdxcp moduleBob Zhou2023-06-091-2/+2
| | | | | | | | | | | | After drm conduct amdgpu Makefile, amdgpu.ko has been created and "amdgpu-y +=" in amdxcp Makefile isn't used. So modify amdgpu-y to amdxcp-y and build amdxcp module. Signed-off-by: Bob Zhou <bob.zhou@amd.com> Reviewed-by: James Zhu <James.Zhu@amd.com> Reviewed-by: Guchun Chen <guchun.chen@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdxcp: add platform device driver for amdxcpJames Zhu2023-06-093-0/+164
Add platform device driver for amdxcp to support amdgpu spatial partition. -v2: fix build warning Signed-off-by: James Zhu <James.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>