diff options
author | Dave Airlie <airlied@redhat.com> | 2016-09-29 23:18:26 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-09-29 23:21:02 -0400 |
commit | 28a396545a2a5fbdffb2b661ed6c9b6820e28772 (patch) | |
tree | 0cc4d3a0a4956cf02c5c2133e382688ed7a30678 /drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | |
parent | b2d7e08903e62b9f504fe6a954425b737aa9ff96 (diff) | |
parent | a481daa88fd4d6b54f25348972bba10b5f6a84d0 (diff) |
Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next
Some additional fixes for 4.9:
- The rest of Christian's GTT rework which fixes a long standing bug
in the GPUVM code among other things
- Changes to the pci shutdown callbacks for certain hypervisors
- Fix hpd interrupt storms on eDP panels which have the hpd interrupt
enabled by the bios
- misc cleanups and bug fixes
* 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux: (33 commits)
drm/radeon: always apply pci shutdown callbacks
drm/amdgpu: always apply pci shutdown callbacks (v2)
drm/amdgpu: improve VM PTE trace points
drm/amdgpu: fix GART_DEBUGFS define
drm/amdgpu: free userptrs even if GTT isn't bound
drm/amd/amdgpu: Various cleanups for DCEv6
drm/amdgpu: fix BO move offsets
drm/amdgpu: fix amdgpu_move_blit on 32bit systems
drm/amdgpu: fix gtt_mgr bo's offset
drm/amdgpu: fix initializing the VM BO shadow
drm/amdgpu: fix initializing the VM last eviction counter
drm/amdgpu: cleanup VM shadow BO unreferencing
drm/amdgpu: allocate GTT space for shadow VM page tables
drm/amdgpu: rename all rbo variable to abo v2
drm/amdgpu: remove unused member from struct amdgpu_bo
drm/amdgpu: add a custom GTT memory manager v2
drm/amdgpu/dce6: disable hpd on local panels
drm/amdgpu/dce8: disable hpd on local panels
drm/amdgpu/dce11: disable hpd on local panels
drm/amdgpu/dce10: disable hpd on local panels
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c index 107fbb2d2847..9fb8aa4d6bae 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | |||
@@ -115,14 +115,14 @@ int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tile | |||
115 | 115 | ||
116 | static void amdgpufb_destroy_pinned_object(struct drm_gem_object *gobj) | 116 | static void amdgpufb_destroy_pinned_object(struct drm_gem_object *gobj) |
117 | { | 117 | { |
118 | struct amdgpu_bo *rbo = gem_to_amdgpu_bo(gobj); | 118 | struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj); |
119 | int ret; | 119 | int ret; |
120 | 120 | ||
121 | ret = amdgpu_bo_reserve(rbo, false); | 121 | ret = amdgpu_bo_reserve(abo, false); |
122 | if (likely(ret == 0)) { | 122 | if (likely(ret == 0)) { |
123 | amdgpu_bo_kunmap(rbo); | 123 | amdgpu_bo_kunmap(abo); |
124 | amdgpu_bo_unpin(rbo); | 124 | amdgpu_bo_unpin(abo); |
125 | amdgpu_bo_unreserve(rbo); | 125 | amdgpu_bo_unreserve(abo); |
126 | } | 126 | } |
127 | drm_gem_object_unreference_unlocked(gobj); | 127 | drm_gem_object_unreference_unlocked(gobj); |
128 | } | 128 | } |
@@ -133,7 +133,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, | |||
133 | { | 133 | { |
134 | struct amdgpu_device *adev = rfbdev->adev; | 134 | struct amdgpu_device *adev = rfbdev->adev; |
135 | struct drm_gem_object *gobj = NULL; | 135 | struct drm_gem_object *gobj = NULL; |
136 | struct amdgpu_bo *rbo = NULL; | 136 | struct amdgpu_bo *abo = NULL; |
137 | bool fb_tiled = false; /* useful for testing */ | 137 | bool fb_tiled = false; /* useful for testing */ |
138 | u32 tiling_flags = 0; | 138 | u32 tiling_flags = 0; |
139 | int ret; | 139 | int ret; |
@@ -159,30 +159,30 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, | |||
159 | aligned_size); | 159 | aligned_size); |
160 | return -ENOMEM; | 160 | return -ENOMEM; |
161 | } | 161 | } |
162 | rbo = gem_to_amdgpu_bo(gobj); | 162 | abo = gem_to_amdgpu_bo(gobj); |
163 | 163 | ||
164 | if (fb_tiled) | 164 | if (fb_tiled) |
165 | tiling_flags = AMDGPU_TILING_SET(ARRAY_MODE, GRPH_ARRAY_2D_TILED_THIN1); | 165 | tiling_flags = AMDGPU_TILING_SET(ARRAY_MODE, GRPH_ARRAY_2D_TILED_THIN1); |
166 | 166 | ||
167 | ret = amdgpu_bo_reserve(rbo, false); | 167 | ret = amdgpu_bo_reserve(abo, false); |
168 | if (unlikely(ret != 0)) | 168 | if (unlikely(ret != 0)) |
169 | goto out_unref; | 169 | goto out_unref; |
170 | 170 | ||
171 | if (tiling_flags) { | 171 | if (tiling_flags) { |
172 | ret = amdgpu_bo_set_tiling_flags(rbo, | 172 | ret = amdgpu_bo_set_tiling_flags(abo, |
173 | tiling_flags); | 173 | tiling_flags); |
174 | if (ret) | 174 | if (ret) |
175 | dev_err(adev->dev, "FB failed to set tiling flags\n"); | 175 | dev_err(adev->dev, "FB failed to set tiling flags\n"); |
176 | } | 176 | } |
177 | 177 | ||
178 | 178 | ||
179 | ret = amdgpu_bo_pin_restricted(rbo, AMDGPU_GEM_DOMAIN_VRAM, 0, 0, NULL); | 179 | ret = amdgpu_bo_pin_restricted(abo, AMDGPU_GEM_DOMAIN_VRAM, 0, 0, NULL); |
180 | if (ret) { | 180 | if (ret) { |
181 | amdgpu_bo_unreserve(rbo); | 181 | amdgpu_bo_unreserve(abo); |
182 | goto out_unref; | 182 | goto out_unref; |
183 | } | 183 | } |
184 | ret = amdgpu_bo_kmap(rbo, NULL); | 184 | ret = amdgpu_bo_kmap(abo, NULL); |
185 | amdgpu_bo_unreserve(rbo); | 185 | amdgpu_bo_unreserve(abo); |
186 | if (ret) { | 186 | if (ret) { |
187 | goto out_unref; | 187 | goto out_unref; |
188 | } | 188 | } |
@@ -204,7 +204,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, | |||
204 | struct drm_framebuffer *fb = NULL; | 204 | struct drm_framebuffer *fb = NULL; |
205 | struct drm_mode_fb_cmd2 mode_cmd; | 205 | struct drm_mode_fb_cmd2 mode_cmd; |
206 | struct drm_gem_object *gobj = NULL; | 206 | struct drm_gem_object *gobj = NULL; |
207 | struct amdgpu_bo *rbo = NULL; | 207 | struct amdgpu_bo *abo = NULL; |
208 | int ret; | 208 | int ret; |
209 | unsigned long tmp; | 209 | unsigned long tmp; |
210 | 210 | ||
@@ -223,7 +223,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, | |||
223 | return ret; | 223 | return ret; |
224 | } | 224 | } |
225 | 225 | ||
226 | rbo = gem_to_amdgpu_bo(gobj); | 226 | abo = gem_to_amdgpu_bo(gobj); |
227 | 227 | ||
228 | /* okay we have an object now allocate the framebuffer */ | 228 | /* okay we have an object now allocate the framebuffer */ |
229 | info = drm_fb_helper_alloc_fbi(helper); | 229 | info = drm_fb_helper_alloc_fbi(helper); |
@@ -246,7 +246,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, | |||
246 | /* setup helper */ | 246 | /* setup helper */ |
247 | rfbdev->helper.fb = fb; | 247 | rfbdev->helper.fb = fb; |
248 | 248 | ||
249 | memset_io(rbo->kptr, 0x0, amdgpu_bo_size(rbo)); | 249 | memset_io(abo->kptr, 0x0, amdgpu_bo_size(abo)); |
250 | 250 | ||
251 | strcpy(info->fix.id, "amdgpudrmfb"); | 251 | strcpy(info->fix.id, "amdgpudrmfb"); |
252 | 252 | ||
@@ -255,11 +255,11 @@ static int amdgpufb_create(struct drm_fb_helper *helper, | |||
255 | info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT; | 255 | info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT; |
256 | info->fbops = &amdgpufb_ops; | 256 | info->fbops = &amdgpufb_ops; |
257 | 257 | ||
258 | tmp = amdgpu_bo_gpu_offset(rbo) - adev->mc.vram_start; | 258 | tmp = amdgpu_bo_gpu_offset(abo) - adev->mc.vram_start; |
259 | info->fix.smem_start = adev->mc.aper_base + tmp; | 259 | info->fix.smem_start = adev->mc.aper_base + tmp; |
260 | info->fix.smem_len = amdgpu_bo_size(rbo); | 260 | info->fix.smem_len = amdgpu_bo_size(abo); |
261 | info->screen_base = rbo->kptr; | 261 | info->screen_base = abo->kptr; |
262 | info->screen_size = amdgpu_bo_size(rbo); | 262 | info->screen_size = amdgpu_bo_size(abo); |
263 | 263 | ||
264 | drm_fb_helper_fill_var(info, &rfbdev->helper, sizes->fb_width, sizes->fb_height); | 264 | drm_fb_helper_fill_var(info, &rfbdev->helper, sizes->fb_width, sizes->fb_height); |
265 | 265 | ||
@@ -276,7 +276,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, | |||
276 | 276 | ||
277 | DRM_INFO("fb mappable at 0x%lX\n", info->fix.smem_start); | 277 | DRM_INFO("fb mappable at 0x%lX\n", info->fix.smem_start); |
278 | DRM_INFO("vram apper at 0x%lX\n", (unsigned long)adev->mc.aper_base); | 278 | DRM_INFO("vram apper at 0x%lX\n", (unsigned long)adev->mc.aper_base); |
279 | DRM_INFO("size %lu\n", (unsigned long)amdgpu_bo_size(rbo)); | 279 | DRM_INFO("size %lu\n", (unsigned long)amdgpu_bo_size(abo)); |
280 | DRM_INFO("fb depth is %d\n", fb->depth); | 280 | DRM_INFO("fb depth is %d\n", fb->depth); |
281 | DRM_INFO(" pitch is %d\n", fb->pitches[0]); | 281 | DRM_INFO(" pitch is %d\n", fb->pitches[0]); |
282 | 282 | ||
@@ -286,7 +286,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, | |||
286 | out_destroy_fbi: | 286 | out_destroy_fbi: |
287 | drm_fb_helper_release_fbi(helper); | 287 | drm_fb_helper_release_fbi(helper); |
288 | out_unref: | 288 | out_unref: |
289 | if (rbo) { | 289 | if (abo) { |
290 | 290 | ||
291 | } | 291 | } |
292 | if (fb && ret) { | 292 | if (fb && ret) { |