Skip to content

Commit 01d0735

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "I really need to get back to sending these on my Friday, instead of my Monday morning, but nothing too amazing in here: a few amdkfd fixes, a few radeon fixes, i915 fixes, one tegra fix and one core fix" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm: Zero out invalid vblank timestamp in drm_update_vblank_count. drm/tegra: Don't use vblank_disable_immediate on incapable driver. drm/radeon: stop trying to suspend UVD sessions drm/radeon: more strictly validate the UVD codec drm/radeon: make UVD handle checking more strict drm/radeon: make VCE handle check more strict drm/radeon: fix userptr lockup drm/radeon: fix userptr BO unpin bug v3 drm/amdkfd: Initialize sdma vm when creating sdma queue drm/amdkfd: Don't report local memory size drm/amdkfd: allow unregister process with queues drm/i915: Drop PIPE-A quirk for 945GSE HP Mini drm/i915: Sink rate read should be saved in deca-kHz drm/i915/dp: there is no audio on port A drm/i915: Add missing MacBook Pro models with dual channel LVDS drm/i915: Assume dual channel LVDS if pixel clock necessitates it drm/radeon: don't setup audio on asics that don't support it drm/radeon: disable semaphores for UVD V1 (v2)
2 parents 41f2a93 + 332545b commit 01d0735

18 files changed

+230
-106
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,10 @@ static int unregister_process_nocpsch(struct device_queue_manager *dqm,
430430

431431
BUG_ON(!dqm || !qpd);
432432

433-
BUG_ON(!list_empty(&qpd->queues_list));
433+
pr_debug("In func %s\n", __func__);
434434

435-
pr_debug("kfd: In func %s\n", __func__);
435+
pr_debug("qpd->queues_list is %s\n",
436+
list_empty(&qpd->queues_list) ? "empty" : "not empty");
436437

437438
retval = 0;
438439
mutex_lock(&dqm->lock);
@@ -882,6 +883,8 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
882883
return -ENOMEM;
883884
}
884885

886+
init_sdma_vm(dqm, q, qpd);
887+
885888
retval = mqd->init_mqd(mqd, &q->mqd, &q->mqd_mem_obj,
886889
&q->gart_mqd_addr, &q->properties);
887890
if (retval != 0)

drivers/gpu/drm/amd/amdkfd/kfd_topology.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,9 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
728728
sysfs_show_32bit_prop(buffer, "max_engine_clk_fcompute",
729729
dev->gpu->kfd2kgd->get_max_engine_clock_in_mhz(
730730
dev->gpu->kgd));
731+
731732
sysfs_show_64bit_prop(buffer, "local_mem_size",
732-
dev->gpu->kfd2kgd->get_vmem_size(
733-
dev->gpu->kgd));
733+
(unsigned long long int) 0);
734734

735735
sysfs_show_32bit_prop(buffer, "fw_version",
736736
dev->gpu->kfd2kgd->get_fw_version(

drivers/gpu/drm/drm_irq.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,11 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc)
131131

132132
/* Reinitialize corresponding vblank timestamp if high-precision query
133133
* available. Skip this step if query unsupported or failed. Will
134-
* reinitialize delayed at next vblank interrupt in that case.
134+
* reinitialize delayed at next vblank interrupt in that case and
135+
* assign 0 for now, to mark the vblanktimestamp as invalid.
135136
*/
136-
if (rc) {
137-
tslot = atomic_read(&vblank->count) + diff;
138-
vblanktimestamp(dev, crtc, tslot) = t_vblank;
139-
}
137+
tslot = atomic_read(&vblank->count) + diff;
138+
vblanktimestamp(dev, crtc, tslot) = rc ? t_vblank : (struct timeval) {0, 0};
140139

141140
smp_mb__before_atomic();
142141
atomic_add(diff, &vblank->count);

drivers/gpu/drm/i915/intel_display.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13635,9 +13635,6 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
1363513635
};
1363613636

1363713637
static struct intel_quirk intel_quirks[] = {
13638-
/* HP Mini needs pipe A force quirk (LP: #322104) */
13639-
{ 0x27ae, 0x103c, 0x361a, quirk_pipea_force },
13640-
1364113638
/* Toshiba Protege R-205, S-209 needs pipe A force quirk */
1364213639
{ 0x2592, 0x1179, 0x0001, quirk_pipea_force },
1364313640

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
13481348

13491349
pipe_config->has_dp_encoder = true;
13501350
pipe_config->has_drrs = false;
1351-
pipe_config->has_audio = intel_dp->has_audio;
1351+
pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
13521352

13531353
if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
13541354
intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -2211,8 +2211,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
22112211
int dotclock;
22122212

22132213
tmp = I915_READ(intel_dp->output_reg);
2214-
if (tmp & DP_AUDIO_OUTPUT_ENABLE)
2215-
pipe_config->has_audio = true;
2214+
2215+
pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
22162216

22172217
if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
22182218
if (tmp & DP_SYNC_HS_HIGH)
@@ -3812,7 +3812,8 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
38123812
if (val == 0)
38133813
break;
38143814

3815-
intel_dp->sink_rates[i] = val * 200;
3815+
/* Value read is in kHz while drm clock is saved in deca-kHz */
3816+
intel_dp->sink_rates[i] = (val * 200) / 10;
38163817
}
38173818
intel_dp->num_sink_rates = i;
38183819
}

drivers/gpu/drm/i915/intel_lvds.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,28 @@ static int intel_dual_link_lvds_callback(const struct dmi_system_id *id)
813813
static const struct dmi_system_id intel_dual_link_lvds[] = {
814814
{
815815
.callback = intel_dual_link_lvds_callback,
816-
.ident = "Apple MacBook Pro (Core i5/i7 Series)",
816+
.ident = "Apple MacBook Pro 15\" (2010)",
817+
.matches = {
818+
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
819+
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro6,2"),
820+
},
821+
},
822+
{
823+
.callback = intel_dual_link_lvds_callback,
824+
.ident = "Apple MacBook Pro 15\" (2011)",
817825
.matches = {
818826
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
819827
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro8,2"),
820828
},
821829
},
830+
{
831+
.callback = intel_dual_link_lvds_callback,
832+
.ident = "Apple MacBook Pro 15\" (2012)",
833+
.matches = {
834+
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
835+
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9,1"),
836+
},
837+
},
822838
{ } /* terminating entry */
823839
};
824840

@@ -848,6 +864,11 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
848864
if (i915.lvds_channel_mode > 0)
849865
return i915.lvds_channel_mode == 2;
850866

867+
/* single channel LVDS is limited to 112 MHz */
868+
if (lvds_encoder->attached_connector->base.panel.fixed_mode->clock
869+
> 112999)
870+
return true;
871+
851872
if (dmi_check_system(intel_dual_link_lvds))
852873
return true;
853874

@@ -1111,6 +1132,8 @@ void intel_lvds_init(struct drm_device *dev)
11111132
out:
11121133
mutex_unlock(&dev->mode_config.mutex);
11131134

1135+
intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
1136+
11141137
lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
11151138
DRM_DEBUG_KMS("detected %s-link lvds configuration\n",
11161139
lvds_encoder->is_dual_link ? "dual" : "single");
@@ -1125,7 +1148,6 @@ void intel_lvds_init(struct drm_device *dev)
11251148
}
11261149
drm_connector_register(connector);
11271150

1128-
intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
11291151
intel_panel_setup_backlight(connector, INVALID_PIPE);
11301152

11311153
return;

drivers/gpu/drm/radeon/radeon.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,6 @@ struct radeon_uvd {
16731673
struct radeon_bo *vcpu_bo;
16741674
void *cpu_addr;
16751675
uint64_t gpu_addr;
1676-
void *saved_bo;
16771676
atomic_t handles[RADEON_MAX_UVD_HANDLES];
16781677
struct drm_file *filp[RADEON_MAX_UVD_HANDLES];
16791678
unsigned img_size[RADEON_MAX_UVD_HANDLES];

drivers/gpu/drm/radeon/radeon_asic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ static struct radeon_asic rs780_asic = {
12021202
static struct radeon_asic_ring rv770_uvd_ring = {
12031203
.ib_execute = &uvd_v1_0_ib_execute,
12041204
.emit_fence = &uvd_v2_2_fence_emit,
1205-
.emit_semaphore = &uvd_v1_0_semaphore_emit,
1205+
.emit_semaphore = &uvd_v2_2_semaphore_emit,
12061206
.cs_parse = &radeon_uvd_cs_parse,
12071207
.ring_test = &uvd_v1_0_ring_test,
12081208
.ib_test = &uvd_v1_0_ib_test,

drivers/gpu/drm/radeon/radeon_asic.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,10 @@ void uvd_v1_0_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
949949
int uvd_v2_2_resume(struct radeon_device *rdev);
950950
void uvd_v2_2_fence_emit(struct radeon_device *rdev,
951951
struct radeon_fence *fence);
952+
bool uvd_v2_2_semaphore_emit(struct radeon_device *rdev,
953+
struct radeon_ring *ring,
954+
struct radeon_semaphore *semaphore,
955+
bool emit_wait);
952956

953957
/* uvd v3.1 */
954958
bool uvd_v3_1_semaphore_emit(struct radeon_device *rdev,

drivers/gpu/drm/radeon/radeon_audio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,10 @@ void radeon_audio_detect(struct drm_connector *connector,
464464
return;
465465

466466
rdev = connector->encoder->dev->dev_private;
467+
468+
if (!radeon_audio_chipset_supported(rdev))
469+
return;
470+
467471
radeon_encoder = to_radeon_encoder(connector->encoder);
468472
dig = radeon_encoder->enc_priv;
469473

drivers/gpu/drm/radeon/radeon_mn.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ static void radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
142142

143143
list_for_each_entry(bo, &node->bos, mn_list) {
144144

145+
if (!bo->tbo.ttm || bo->tbo.ttm->state != tt_bound)
146+
continue;
147+
145148
r = radeon_bo_reserve(bo, true);
146149
if (r) {
147150
DRM_ERROR("(%ld) failed to reserve user bo\n", r);

drivers/gpu/drm/radeon/radeon_ttm.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,7 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
591591
{
592592
struct radeon_device *rdev = radeon_get_rdev(ttm->bdev);
593593
struct radeon_ttm_tt *gtt = (void *)ttm;
594-
struct scatterlist *sg;
595-
int i;
594+
struct sg_page_iter sg_iter;
596595

597596
int write = !(gtt->userflags & RADEON_GEM_USERPTR_READONLY);
598597
enum dma_data_direction direction = write ?
@@ -605,9 +604,8 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
605604
/* free the sg table and pages again */
606605
dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
607606

608-
for_each_sg(ttm->sg->sgl, sg, ttm->sg->nents, i) {
609-
struct page *page = sg_page(sg);
610-
607+
for_each_sg_page(ttm->sg->sgl, &sg_iter, ttm->sg->nents, 0) {
608+
struct page *page = sg_page_iter_page(&sg_iter);
611609
if (!(gtt->userflags & RADEON_GEM_USERPTR_READONLY))
612610
set_page_dirty(page);
613611

0 commit comments

Comments
 (0)