From 407fe1b09100cade0603943ad2fe1252387d9319 Mon Sep 17 00:00:00 2001 From: Kalyan Alle Date: Thu, 3 May 2018 12:00:03 +0530 Subject: [PATCH 3333/4131] Fixes compilation/build issues This patch fixes the build issues came up while porting. Signed-off-by: kalyan alle --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 12 ++++-------- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 8 -------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 ++--- drivers/gpu/drm/amd/amdgpu/psp_v10_0.c | 3 +-- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- drivers/gpu/drm/amd/lib/Makefile | 3 --- drivers/gpu/drm/amd/lib/backport/Makefile | 5 ----- drivers/gpu/drm/amd/lib/backport/backport.h | 6 ------ drivers/gpu/drm/scheduler/gpu_scheduler.c | 2 +- include/drm/drm_modeset_helper_vtables.h | 16 ++++++++++++++++ include/uapi/drm/amdgpu_drm.h | 5 +++++ 14 files changed, 32 insertions(+), 44 deletions(-) delete mode 100644 drivers/gpu/drm/amd/lib/backport/Makefile delete mode 100644 drivers/gpu/drm/amd/lib/backport/backport.h diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index e5471be..8f0aa93 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -336,7 +336,6 @@ static void amdgpu_amdkfd_add_eviction_fence(struct amdgpu_bo *bo, static int amdgpu_amdkfd_bo_validate(struct amdgpu_bo *bo, uint32_t domain, bool wait) { - struct ttm_operation_ctx ctx = { false, false }; int ret; if (WARN(amdgpu_ttm_tt_get_usermm(bo->tbo.ttm), @@ -345,7 +344,7 @@ static int amdgpu_amdkfd_bo_validate(struct amdgpu_bo *bo, uint32_t domain, amdgpu_ttm_placement_from_domain(bo, domain); - ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); + ret = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); if (ret) goto validate_fail; if (wait) { @@ -588,7 +587,6 @@ static int init_user_pages(struct kgd_mem *mem, struct mm_struct *mm, { struct amdkfd_process_info *process_info = mem->process_info; struct amdgpu_bo *bo = mem->bo; - struct ttm_operation_ctx ctx = { true, false }; int ret = 0; mutex_lock(&process_info->lock); @@ -634,7 +632,7 @@ static int init_user_pages(struct kgd_mem *mem, struct mm_struct *mm, goto release_out; } amdgpu_ttm_placement_from_domain(bo, mem->domain); - ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); + ret = ttm_bo_validate(&bo->tbo, &bo->placement, true, false); if (ret) pr_err("%s: failed to validate BO\n", __func__); amdgpu_bo_unreserve(bo); @@ -1961,7 +1959,6 @@ static int update_invalid_user_pages(struct amdkfd_process_info *process_info, { struct kgd_mem *mem, *tmp_mem; struct amdgpu_bo *bo; - struct ttm_operation_ctx ctx = { false, false }; int invalid, ret; /* Move all invalidated BOs to the userptr_inval_list and @@ -1978,7 +1975,7 @@ static int update_invalid_user_pages(struct amdkfd_process_info *process_info, if (amdgpu_bo_reserve(bo, true)) return -EAGAIN; amdgpu_ttm_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU); - ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); + ret = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); amdgpu_bo_unreserve(bo); if (ret) { pr_err("%s: Failed to invalidate userptr BO\n", @@ -2059,7 +2056,6 @@ static int validate_invalid_user_pages(struct amdkfd_process_info *process_info) struct amdkfd_vm *peer_vm; struct kgd_mem *mem, *tmp_mem; struct amdgpu_bo *bo; - struct ttm_operation_ctx ctx = { false, false }; int i, ret; pd_bo_list_entries = kcalloc(process_info->n_vms, @@ -2122,7 +2118,7 @@ static int validate_invalid_user_pages(struct amdkfd_process_info *process_info) amdgpu_ttm_tt_set_user_pages(bo->tbo.ttm, mem->user_pages); amdgpu_ttm_placement_from_domain(bo, mem->domain); - ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); + ret = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); if (ret) { pr_err("%s: failed to validate BO\n", __func__); goto unreserve_out; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 6008f5a..2e705f9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -436,7 +436,7 @@ int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx, unsigned ring_id) if (other) { signed long r; - r = kcl_fence_wait_timeout(other, false, MAX_SCHEDULE_TIMEOUT); + r = dma_fence_wait_timeout(other, false, MAX_SCHEDULE_TIMEOUT); if (r < 0) { DRM_ERROR("Error (%ld) waiting for fence!\n", r); return r; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index b0bdd8a..6414b50 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -855,11 +855,6 @@ static struct drm_driver kms_driver = { .disable_vblank = amdgpu_disable_vblank_kms, .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos, .get_scanout_position = amdgpu_get_crtc_scanout_position, -#if defined(CONFIG_DEBUG_FS) -#endif - .irq_preinstall = amdgpu_irq_preinstall, - .irq_postinstall = amdgpu_irq_postinstall, - .irq_uninstall = amdgpu_irq_uninstall, .irq_handler = amdgpu_irq_handler, .ioctls = amdgpu_ioctls_kms, .gem_free_object_unlocked = amdgpu_gem_object_free, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c index 721ee96..9fe616e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c @@ -256,7 +256,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, /* setup aperture base/size for vesafb takeover */ info->apertures->ranges[0].base = adev->ddev->mode_config.fb_base; - info->aperture_size = adev->gmc.aper_size; + info->apertures->ranges[0].size = adev->gmc.aper_size; /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index 417e60f..d018bf4 100755 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -219,14 +219,6 @@ int amdgpu_bo_create(struct amdgpu_device *adev, struct sg_table *sg, struct reservation_object *resv, struct amdgpu_bo **bo_ptr); -int amdgpu_bo_create_restricted(struct amdgpu_device *adev, - unsigned long size, int byte_align, - bool kernel, u32 domain, u64 flags, - struct sg_table *sg, - struct ttm_placement *placement, - struct reservation_object *resv, - uint64_t init_value, - struct amdgpu_bo **bo_ptr); int amdgpu_bo_create_reserved(struct amdgpu_device *adev, unsigned long size, int align, u32 domain, struct amdgpu_bo **bo_ptr, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index df25b0b..5aea098 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1064,8 +1064,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, return >t->ttm.ttm; } -static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm, - struct ttm_operation_ctx *ctx) +static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm) { struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); struct amdgpu_ttm_tt *gtt = (void *)ttm; @@ -1091,7 +1090,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm, return 0; } - return ttm_populate_and_map_pages(adev->dev, >t->ttm, ctx); + return ttm_populate_and_map_pages(adev->dev, >t->ttm); } static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c index 320fb93..5af4dab 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v10_0.c @@ -30,8 +30,7 @@ #include "soc15_common.h" #include "psp_v10_0.h" -#include "soc15ip.h" -#include "raven1/MP/mp_10_0_offset.h" +#include "mp/mp_10_0_offset.h" #include "gc/gc_9_1_offset.h" #include "sdma0/sdma0_4_1_offset.h" diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h index a832fc3..b13c660 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -266,7 +266,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name, void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc); #else #define amdgpu_dm_crtc_set_crc_source NULL -static inline amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc) {} +static inline void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc) {} #endif extern const struct drm_encoder_helper_funcs amdgpu_dm_encoder_helper_funcs; diff --git a/drivers/gpu/drm/amd/lib/Makefile b/drivers/gpu/drm/amd/lib/Makefile index 35a44c2..2b95bf7 100644 --- a/drivers/gpu/drm/amd/lib/Makefile +++ b/drivers/gpu/drm/amd/lib/Makefile @@ -16,6 +16,3 @@ endif ccflags-y := -I$(src)/../include obj-$(CONFIG_CHASH) += $(CHASH_NAME).o - -LIB_FULL_PATH = $(src) -include $(LIB_FULL_PATH)/backport/Makefile diff --git a/drivers/gpu/drm/amd/lib/backport/Makefile b/drivers/gpu/drm/amd/lib/backport/Makefile deleted file mode 100644 index e214316..0000000 --- a/drivers/gpu/drm/amd/lib/backport/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -LINUXINCLUDE := $(DKMS_INCLUDE_PREFIX) $(LINUXINCLUDE) - -ccflags-y += \ - -I$(LIB_FULL_PATH) \ - -include backport/backport.h diff --git a/drivers/gpu/drm/amd/lib/backport/backport.h b/drivers/gpu/drm/amd/lib/backport/backport.h deleted file mode 100644 index 2c52212..0000000 --- a/drivers/gpu/drm/amd/lib/backport/backport.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef LIB_BACKPORT_H -#define LIB_BACKPORT_H - -#include - -#endif diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c index 2c18996..0d95888 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c @@ -461,7 +461,7 @@ void drm_sched_hw_job_reset(struct drm_gpu_scheduler *sched, struct drm_sched_jo { struct drm_sched_job *s_job; struct drm_sched_entity *entity, *tmp; - int i;; + int i; spin_lock(&sched->job_list_lock); list_for_each_entry_reverse(s_job, &sched->ring_mirror_list, node) { diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index c55cf3f..54659d3 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -266,6 +266,22 @@ struct drm_crtc_helper_funcs { struct drm_framebuffer *fb, int x, int y, enum mode_set_atomic); + /** + * @load_lut: + * + * Load a LUT prepared with the &drm_fb_helper_funcs.gamma_set vfunc. + * + * This callback is optional and is only used by the fbdev emulation + * helpers. + * + * FIXME: + * + * This callback is functionally redundant with the core gamma table + * support and simply exists because the fbdev hasn't yet been + * refactored to use the core gamma table interfaces. + */ + void (*load_lut)(struct drm_crtc *crtc); + /** * @disable: * diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index c9aed87..28b1a44 100644 --- a/include/uapi/drm/amdgpu_drm.h +++ b/include/uapi/drm/amdgpu_drm.h @@ -730,8 +730,13 @@ struct drm_amdgpu_cs_chunk_data { #define AMDGPU_INFO_SENSOR_VDDNB 0x6 /* Subquery id: Query graphics voltage */ #define AMDGPU_INFO_SENSOR_VDDGFX 0x7 + /* Subquery id: Query GPU stable pstate shader clock */ + #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8 + /* Subquery id: Query GPU stable pstate memory clock */ + #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9 /* Number of VRAM page faults on CPU access. */ #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E +#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F /* Hybrid Stack Specific Defs*/ /* gpu capability */ -- 2.7.4