Skip to content

Commit c353bfc

Browse files
committed
Merge tag 'drm-for-v4.15-part2' of git://people.freedesktop.org/~airlied/linux
Pull more drm updates from Dave Airlie: "Fixes/cleanups for rc1, non-desktop flags for VR - remove the MSM dt-bindings file Rob managed to push in the previous pull. - add a property/edid quirk to denote HMD devices, I had these hanging around for a few weeks and Keith had done some work on them, they are fairly self contained and small, and only affect people using HTC Vive VR headsets so far. - amdgpu, tegra, tilcdc, fsl fixes - some imx-drm cleanups I missed, these seemed pretty small, and no reason to hold off. I have one TTM regression fix (fixes bochs-vga in qemu) sitting locally awaiting review I'll probably send that in a separate pull request tomorrow" * tag 'drm-for-v4.15-part2' of git://people.freedesktop.org/~airlied/linux: (33 commits) dt-bindings: remove file that was added accidentally drm/edid: quirk HTC vive headset as non-desktop. [v2] drm/fb: add support for not enabling fbcon on non-desktop displays [v2] drm: add connector info/property for non-desktop displays [v2] drm/amdgpu: fix rmmod KCQ disable failed error drm/amdgpu: fix kernel hang when starting VNC server drm/amdgpu: don't skip attributes when powerplay is enabled drm/amd/pp: fix typecast error in powerplay. drm/tilcdc: Remove obsolete "ti,tilcdc,slave" dts binding support drm/tegra: sor: Reimplement pad clock Revert "drm/radeon: dont switch vt on suspend" drm/amd/amdgpu: fix over-bound accessing in amdgpu_cs_wait_any_fence drm/amd/powerplay: fix unfreeze level smc message for smu7 drm/amdgpu:fix memleak drm/amdgpu:fix memleak in takedown drm/amd/pp: fix dpm randomly failed on Vega10 drm/amdgpu: set f_mapping on exported DMA-bufs drm/amdgpu: Properly allocate VM invalidate eng v2 drm/fsl-dcu: enable IRQ before drm_atomic_helper_resume() drm/fsl-dcu: avoid disabling pixel clock twice on suspend ...
2 parents 1d3bc63 + 98ecf1a commit c353bfc

39 files changed

+281
-1399
lines changed

Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Optional properties:
129129

130130
example:
131131

132-
display@di0 {
132+
disp0 {
133133
compatible = "fsl,imx-parallel-display";
134134
edid = [edid-data];
135135
interface-pix-fmt = "rgb24";

drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ static bool check_atom_bios(uint8_t *bios, size_t size)
5959
return false;
6060
}
6161

62-
tmp = bios[0x18] | (bios[0x19] << 8);
63-
if (bios[tmp + 0x14] != 0x0) {
64-
DRM_INFO("Not an x86 BIOS ROM\n");
65-
return false;
66-
}
67-
6862
bios_header_start = bios[0x48] | (bios[0x49] << 8);
6963
if (!bios_header_start) {
7064
DRM_INFO("Can't locate bios header\n");

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,8 +1495,11 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev,
14951495
memset(wait, 0, sizeof(*wait));
14961496
wait->out.status = (r > 0);
14971497
wait->out.first_signaled = first;
1498-
/* set return value 0 to indicate success */
1499-
r = array[first]->error;
1498+
1499+
if (first < fence_count && array[first])
1500+
r = array[first]->error;
1501+
else
1502+
r = 0;
15001503

15011504
err_free_fence_array:
15021505
for (i = 0; i < fence_count; i++)

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,9 @@ static int amdgpu_fini(struct amdgpu_device *adev)
18371837
adev->ip_blocks[i].status.hw = false;
18381838
}
18391839

1840+
if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
1841+
amdgpu_ucode_fini_bo(adev);
1842+
18401843
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
18411844
if (!adev->ip_blocks[i].status.sw)
18421845
continue;
@@ -3261,9 +3264,9 @@ static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf,
32613264
pm_pg_lock = (*pos >> 23) & 1;
32623265

32633266
if (*pos & (1ULL << 62)) {
3264-
se_bank = (*pos >> 24) & 0x3FF;
3265-
sh_bank = (*pos >> 34) & 0x3FF;
3266-
instance_bank = (*pos >> 44) & 0x3FF;
3267+
se_bank = (*pos & GENMASK_ULL(33, 24)) >> 24;
3268+
sh_bank = (*pos & GENMASK_ULL(43, 34)) >> 34;
3269+
instance_bank = (*pos & GENMASK_ULL(53, 44)) >> 44;
32673270

32683271
if (se_bank == 0x3FF)
32693272
se_bank = 0xFFFFFFFF;
@@ -3337,9 +3340,9 @@ static ssize_t amdgpu_debugfs_regs_write(struct file *f, const char __user *buf,
33373340
pm_pg_lock = (*pos >> 23) & 1;
33383341

33393342
if (*pos & (1ULL << 62)) {
3340-
se_bank = (*pos >> 24) & 0x3FF;
3341-
sh_bank = (*pos >> 34) & 0x3FF;
3342-
instance_bank = (*pos >> 44) & 0x3FF;
3343+
se_bank = (*pos & GENMASK_ULL(33, 24)) >> 24;
3344+
sh_bank = (*pos & GENMASK_ULL(43, 34)) >> 34;
3345+
instance_bank = (*pos & GENMASK_ULL(53, 44)) >> 44;
33433346

33443347
if (se_bank == 0x3FF)
33453348
se_bank = 0xFFFFFFFF;
@@ -3687,12 +3690,12 @@ static ssize_t amdgpu_debugfs_wave_read(struct file *f, char __user *buf,
36873690
return -EINVAL;
36883691

36893692
/* decode offset */
3690-
offset = (*pos & 0x7F);
3691-
se = ((*pos >> 7) & 0xFF);
3692-
sh = ((*pos >> 15) & 0xFF);
3693-
cu = ((*pos >> 23) & 0xFF);
3694-
wave = ((*pos >> 31) & 0xFF);
3695-
simd = ((*pos >> 37) & 0xFF);
3693+
offset = (*pos & GENMASK_ULL(6, 0));
3694+
se = (*pos & GENMASK_ULL(14, 7)) >> 7;
3695+
sh = (*pos & GENMASK_ULL(22, 15)) >> 15;
3696+
cu = (*pos & GENMASK_ULL(30, 23)) >> 23;
3697+
wave = (*pos & GENMASK_ULL(36, 31)) >> 31;
3698+
simd = (*pos & GENMASK_ULL(44, 37)) >> 37;
36963699

36973700
/* switch to the specific se/sh/cu */
36983701
mutex_lock(&adev->grbm_idx_mutex);
@@ -3737,14 +3740,14 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
37373740
return -EINVAL;
37383741

37393742
/* decode offset */
3740-
offset = (*pos & 0xFFF); /* in dwords */
3741-
se = ((*pos >> 12) & 0xFF);
3742-
sh = ((*pos >> 20) & 0xFF);
3743-
cu = ((*pos >> 28) & 0xFF);
3744-
wave = ((*pos >> 36) & 0xFF);
3745-
simd = ((*pos >> 44) & 0xFF);
3746-
thread = ((*pos >> 52) & 0xFF);
3747-
bank = ((*pos >> 60) & 1);
3743+
offset = *pos & GENMASK_ULL(11, 0);
3744+
se = (*pos & GENMASK_ULL(19, 12)) >> 12;
3745+
sh = (*pos & GENMASK_ULL(27, 20)) >> 20;
3746+
cu = (*pos & GENMASK_ULL(35, 28)) >> 28;
3747+
wave = (*pos & GENMASK_ULL(43, 36)) >> 36;
3748+
simd = (*pos & GENMASK_ULL(51, 44)) >> 44;
3749+
thread = (*pos & GENMASK_ULL(59, 52)) >> 52;
3750+
bank = (*pos & GENMASK_ULL(61, 60)) >> 60;
37483751

37493752
data = kmalloc_array(1024, sizeof(*data), GFP_KERNEL);
37503753
if (!data)

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
6363
flags, NULL, resv, 0, &bo);
6464
if (r) {
6565
if (r != -ERESTARTSYS) {
66+
if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) {
67+
flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
68+
goto retry;
69+
}
70+
6671
if (initial_domain == AMDGPU_GEM_DOMAIN_VRAM) {
6772
initial_domain |= AMDGPU_GEM_DOMAIN_GTT;
6873
goto retry;
@@ -323,7 +328,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
323328
r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm,
324329
bo->tbo.ttm->pages);
325330
if (r)
326-
goto unlock_mmap_sem;
331+
goto release_object;
327332

328333
r = amdgpu_bo_reserve(bo, true);
329334
if (r)
@@ -348,9 +353,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
348353
free_pages:
349354
release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages);
350355

351-
unlock_mmap_sem:
352-
up_read(&current->mm->mmap_sem);
353-
354356
release_object:
355357
drm_gem_object_put_unlocked(gobj);
356358

@@ -556,9 +558,8 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
556558

557559
if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
558560
dev_err(&dev->pdev->dev,
559-
"va_address 0x%lX is in reserved area 0x%X\n",
560-
(unsigned long)args->va_address,
561-
AMDGPU_VA_RESERVED_SIZE);
561+
"va_address 0x%LX is in reserved area 0x%LX\n",
562+
args->va_address, AMDGPU_VA_RESERVED_SIZE);
562563
return -EINVAL;
563564
}
564565

drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ static int amdgpu_gtt_mgr_fini(struct ttm_mem_type_manager *man)
7171
{
7272
struct amdgpu_gtt_mgr *mgr = man->priv;
7373

74-
spin_lock(&mgr->lock);
75-
if (!drm_mm_clean(&mgr->mm)) {
76-
spin_unlock(&mgr->lock);
77-
return -EBUSY;
78-
}
79-
8074
drm_mm_takedown(&mgr->mm);
8175
spin_unlock(&mgr->lock);
8276
kfree(mgr);

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,10 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
946946
struct amdgpu_device *adev = dev_get_drvdata(dev);
947947
umode_t effective_mode = attr->mode;
948948

949+
/* no skipping for powerplay */
950+
if (adev->powerplay.cgs_device)
951+
return effective_mode;
952+
949953
/* Skip limit attributes if DPM is not enabled */
950954
if (!adev->pm.dpm_enabled &&
951955
(attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||

drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ static int amdgpu_pp_hw_fini(void *handle)
164164
ret = adev->powerplay.ip_funcs->hw_fini(
165165
adev->powerplay.pp_handle);
166166

167-
if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
168-
amdgpu_ucode_fini_bo(adev);
169-
170167
return ret;
171168
}
172169

drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,14 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
169169
int flags)
170170
{
171171
struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj);
172+
struct dma_buf *buf;
172173

173174
if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm) ||
174175
bo->flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID)
175176
return ERR_PTR(-EPERM);
176177

177-
return drm_gem_prime_export(dev, gobj, flags);
178+
buf = drm_gem_prime_export(dev, gobj, flags);
179+
if (!IS_ERR(buf))
180+
buf->file->f_mapping = dev->anon_inode->i_mapping;
181+
return buf;
178182
}

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ static int psp_hw_fini(void *handle)
442442
if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
443443
return 0;
444444

445-
amdgpu_ucode_fini_bo(adev);
446-
447445
psp_ring_destroy(psp, PSP_RING_TYPE__KM);
448446

449447
amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);

0 commit comments

Comments
 (0)