Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next
New features for 4.21: amdgpu: - Support for SDMA paging queue on vega - Put compute EOP buffers into vram for better performance - Share more code with amdkfd - Support for scanout with DCC on gfx9 - Initial kerneldoc for DC - Updated SMU firmware support for gfx8 chips - Rework CSA handling for eventual support for preemption - XGMI PSP support - Clean up RLC handling - Enable GPU reset by default on VI, SOC15 dGPUs - Ring and IB test cleanups amdkfd: - Share more code with amdgpu ttm: - Move global init out of the drivers scheduler: - Track if schedulers are ready for work - Timeout/fault handling changes to facilitate GPU recovery Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181114165113.3751-1-alexander.deucher@amd.com
This commit is contained in:
@@ -77,8 +77,6 @@ struct bochs_device {
|
||||
|
||||
/* ttm */
|
||||
struct {
|
||||
struct drm_global_reference mem_global_ref;
|
||||
struct ttm_bo_global_ref bo_global_ref;
|
||||
struct ttm_bo_device bdev;
|
||||
bool initialized;
|
||||
} ttm;
|
||||
|
@@ -16,61 +16,6 @@ static inline struct bochs_device *bochs_bdev(struct ttm_bo_device *bd)
|
||||
return container_of(bd, struct bochs_device, ttm.bdev);
|
||||
}
|
||||
|
||||
static int bochs_ttm_mem_global_init(struct drm_global_reference *ref)
|
||||
{
|
||||
return ttm_mem_global_init(ref->object);
|
||||
}
|
||||
|
||||
static void bochs_ttm_mem_global_release(struct drm_global_reference *ref)
|
||||
{
|
||||
ttm_mem_global_release(ref->object);
|
||||
}
|
||||
|
||||
static int bochs_ttm_global_init(struct bochs_device *bochs)
|
||||
{
|
||||
struct drm_global_reference *global_ref;
|
||||
int r;
|
||||
|
||||
global_ref = &bochs->ttm.mem_global_ref;
|
||||
global_ref->global_type = DRM_GLOBAL_TTM_MEM;
|
||||
global_ref->size = sizeof(struct ttm_mem_global);
|
||||
global_ref->init = &bochs_ttm_mem_global_init;
|
||||
global_ref->release = &bochs_ttm_mem_global_release;
|
||||
r = drm_global_item_ref(global_ref);
|
||||
if (r != 0) {
|
||||
DRM_ERROR("Failed setting up TTM memory accounting "
|
||||
"subsystem.\n");
|
||||
return r;
|
||||
}
|
||||
|
||||
bochs->ttm.bo_global_ref.mem_glob =
|
||||
bochs->ttm.mem_global_ref.object;
|
||||
global_ref = &bochs->ttm.bo_global_ref.ref;
|
||||
global_ref->global_type = DRM_GLOBAL_TTM_BO;
|
||||
global_ref->size = sizeof(struct ttm_bo_global);
|
||||
global_ref->init = &ttm_bo_global_init;
|
||||
global_ref->release = &ttm_bo_global_release;
|
||||
r = drm_global_item_ref(global_ref);
|
||||
if (r != 0) {
|
||||
DRM_ERROR("Failed setting up TTM BO subsystem.\n");
|
||||
drm_global_item_unref(&bochs->ttm.mem_global_ref);
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bochs_ttm_global_release(struct bochs_device *bochs)
|
||||
{
|
||||
if (bochs->ttm.mem_global_ref.release == NULL)
|
||||
return;
|
||||
|
||||
drm_global_item_unref(&bochs->ttm.bo_global_ref.ref);
|
||||
drm_global_item_unref(&bochs->ttm.mem_global_ref);
|
||||
bochs->ttm.mem_global_ref.release = NULL;
|
||||
}
|
||||
|
||||
|
||||
static void bochs_bo_ttm_destroy(struct ttm_buffer_object *tbo)
|
||||
{
|
||||
struct bochs_bo *bo;
|
||||
@@ -208,12 +153,7 @@ int bochs_mm_init(struct bochs_device *bochs)
|
||||
struct ttm_bo_device *bdev = &bochs->ttm.bdev;
|
||||
int ret;
|
||||
|
||||
ret = bochs_ttm_global_init(bochs);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ttm_bo_device_init(&bochs->ttm.bdev,
|
||||
bochs->ttm.bo_global_ref.ref.object,
|
||||
&bochs_bo_driver,
|
||||
bochs->dev->anon_inode->i_mapping,
|
||||
DRM_FILE_PAGE_OFFSET,
|
||||
@@ -240,7 +180,6 @@ void bochs_mm_fini(struct bochs_device *bochs)
|
||||
return;
|
||||
|
||||
ttm_bo_device_release(&bochs->ttm.bdev);
|
||||
bochs_ttm_global_release(bochs);
|
||||
bochs->ttm.initialized = false;
|
||||
}
|
||||
|
||||
|
مرجع در شماره جدید
Block a user