Skip to content

Commit 6f4134b

Browse files
committed
Merge tag 'drm-intel-next-fixes-2020-02-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.6-rc2 Most of these were aimed at a "next fixes" pull already during the merge window, but there were issues with the baseline I used, which resulted in a lot of issues in CI. I've regenerated this stuff piecemeal now, adding gradually to it, and it seems healthy now. Due to the issues this is much bigger than I'd like. But it was obviously necessary to take the time to ensure it's not garbage... Signed-off-by: Dave Airlie <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents e44c1e3 + 2aaaa5e commit 6f4134b

26 files changed

+990
-178
lines changed

drivers/gpu/drm/i915/display/intel_bios.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,16 @@ parse_generic_dtd(struct drm_i915_private *dev_priv,
357357
panel_fixed_mode->hdisplay + dtd->hfront_porch;
358358
panel_fixed_mode->hsync_end =
359359
panel_fixed_mode->hsync_start + dtd->hsync;
360-
panel_fixed_mode->htotal = panel_fixed_mode->hsync_end;
360+
panel_fixed_mode->htotal =
361+
panel_fixed_mode->hdisplay + dtd->hblank;
361362

362363
panel_fixed_mode->vdisplay = dtd->vactive;
363364
panel_fixed_mode->vsync_start =
364365
panel_fixed_mode->vdisplay + dtd->vfront_porch;
365366
panel_fixed_mode->vsync_end =
366367
panel_fixed_mode->vsync_start + dtd->vsync;
367-
panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end;
368+
panel_fixed_mode->vtotal =
369+
panel_fixed_mode->vdisplay + dtd->vblank;
368370

369371
panel_fixed_mode->clock = dtd->pixel_clock;
370372
panel_fixed_mode->width_mm = dtd->width_mm;

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12366,6 +12366,7 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
1236612366
/* Copy parameters to slave plane */
1236712367
linked_state->ctl = plane_state->ctl | PLANE_CTL_YUV420_Y_PLANE;
1236812368
linked_state->color_ctl = plane_state->color_ctl;
12369+
linked_state->view = plane_state->view;
1236912370
memcpy(linked_state->color_plane, plane_state->color_plane,
1237012371
sizeof(linked_state->color_plane));
1237112372

@@ -14476,37 +14477,23 @@ static int intel_atomic_check_crtcs(struct intel_atomic_state *state)
1447614477
return 0;
1447714478
}
1447814479

14479-
static bool intel_cpu_transcoder_needs_modeset(struct intel_atomic_state *state,
14480-
enum transcoder transcoder)
14480+
static bool intel_cpu_transcoders_need_modeset(struct intel_atomic_state *state,
14481+
u8 transcoders)
1448114482
{
14482-
struct intel_crtc_state *new_crtc_state;
14483+
const struct intel_crtc_state *new_crtc_state;
1448314484
struct intel_crtc *crtc;
1448414485
int i;
1448514486

14486-
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i)
14487-
if (new_crtc_state->cpu_transcoder == transcoder)
14488-
return needs_modeset(new_crtc_state);
14487+
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
14488+
if (new_crtc_state->hw.enable &&
14489+
transcoders & BIT(new_crtc_state->cpu_transcoder) &&
14490+
needs_modeset(new_crtc_state))
14491+
return true;
14492+
}
1448914493

1449014494
return false;
1449114495
}
1449214496

14493-
static void
14494-
intel_modeset_synced_crtcs(struct intel_atomic_state *state,
14495-
u8 transcoders)
14496-
{
14497-
struct intel_crtc_state *new_crtc_state;
14498-
struct intel_crtc *crtc;
14499-
int i;
14500-
14501-
for_each_new_intel_crtc_in_state(state, crtc,
14502-
new_crtc_state, i) {
14503-
if (transcoders & BIT(new_crtc_state->cpu_transcoder)) {
14504-
new_crtc_state->uapi.mode_changed = true;
14505-
new_crtc_state->update_pipe = false;
14506-
}
14507-
}
14508-
}
14509-
1451014497
static int
1451114498
intel_modeset_all_tiles(struct intel_atomic_state *state, int tile_grp_id)
1451214499
{
@@ -14662,15 +14649,20 @@ static int intel_atomic_check(struct drm_device *dev,
1466214649
if (intel_dp_mst_is_slave_trans(new_crtc_state)) {
1466314650
enum transcoder master = new_crtc_state->mst_master_transcoder;
1466414651

14665-
if (intel_cpu_transcoder_needs_modeset(state, master)) {
14652+
if (intel_cpu_transcoders_need_modeset(state, BIT(master))) {
1466614653
new_crtc_state->uapi.mode_changed = true;
1466714654
new_crtc_state->update_pipe = false;
1466814655
}
14669-
} else if (is_trans_port_sync_mode(new_crtc_state)) {
14656+
}
14657+
14658+
if (is_trans_port_sync_mode(new_crtc_state)) {
1467014659
u8 trans = new_crtc_state->sync_mode_slaves_mask |
1467114660
BIT(new_crtc_state->master_transcoder);
1467214661

14673-
intel_modeset_synced_crtcs(state, trans);
14662+
if (intel_cpu_transcoders_need_modeset(state, trans)) {
14663+
new_crtc_state->uapi.mode_changed = true;
14664+
new_crtc_state->update_pipe = false;
14665+
}
1467414666
}
1467514667
}
1467614668

drivers/gpu/drm/i915/display/intel_dsi_vbt.c

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
384384
return data;
385385
}
386386

387+
#ifdef CONFIG_ACPI
387388
static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
388389
{
389390
struct i2c_adapter_lookup *lookup = data;
@@ -393,8 +394,7 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
393394
acpi_handle adapter_handle;
394395
acpi_status status;
395396

396-
if (intel_dsi->i2c_bus_num >= 0 ||
397-
!i2c_acpi_get_i2c_resource(ares, &sb))
397+
if (!i2c_acpi_get_i2c_resource(ares, &sb))
398398
return 1;
399399

400400
if (lookup->slave_addr != sb->slave_address)
@@ -413,14 +413,41 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
413413
return 1;
414414
}
415415

416-
static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
416+
static void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
417+
const u16 slave_addr)
417418
{
418419
struct drm_device *drm_dev = intel_dsi->base.base.dev;
419420
struct device *dev = &drm_dev->pdev->dev;
420-
struct i2c_adapter *adapter;
421421
struct acpi_device *acpi_dev;
422422
struct list_head resource_list;
423423
struct i2c_adapter_lookup lookup;
424+
425+
acpi_dev = ACPI_COMPANION(dev);
426+
if (acpi_dev) {
427+
memset(&lookup, 0, sizeof(lookup));
428+
lookup.slave_addr = slave_addr;
429+
lookup.intel_dsi = intel_dsi;
430+
lookup.dev_handle = acpi_device_handle(acpi_dev);
431+
432+
INIT_LIST_HEAD(&resource_list);
433+
acpi_dev_get_resources(acpi_dev, &resource_list,
434+
i2c_adapter_lookup,
435+
&lookup);
436+
acpi_dev_free_resource_list(&resource_list);
437+
}
438+
}
439+
#else
440+
static inline void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
441+
const u16 slave_addr)
442+
{
443+
}
444+
#endif
445+
446+
static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
447+
{
448+
struct drm_device *drm_dev = intel_dsi->base.base.dev;
449+
struct device *dev = &drm_dev->pdev->dev;
450+
struct i2c_adapter *adapter;
424451
struct i2c_msg msg;
425452
int ret;
426453
u8 vbt_i2c_bus_num = *(data + 2);
@@ -431,20 +458,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
431458

432459
if (intel_dsi->i2c_bus_num < 0) {
433460
intel_dsi->i2c_bus_num = vbt_i2c_bus_num;
434-
435-
acpi_dev = ACPI_COMPANION(dev);
436-
if (acpi_dev) {
437-
memset(&lookup, 0, sizeof(lookup));
438-
lookup.slave_addr = slave_addr;
439-
lookup.intel_dsi = intel_dsi;
440-
lookup.dev_handle = acpi_device_handle(acpi_dev);
441-
442-
INIT_LIST_HEAD(&resource_list);
443-
acpi_dev_get_resources(acpi_dev, &resource_list,
444-
i2c_adapter_lookup,
445-
&lookup);
446-
acpi_dev_free_resource_list(&resource_list);
447-
}
461+
i2c_acpi_find_adapter(intel_dsi, slave_addr);
448462
}
449463

450464
adapter = i2c_get_adapter(intel_dsi->i2c_bus_num);

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,9 +1981,20 @@ static int __eb_parse(struct dma_fence_work *work)
19811981
pw->trampoline);
19821982
}
19831983

1984+
static void __eb_parse_release(struct dma_fence_work *work)
1985+
{
1986+
struct eb_parse_work *pw = container_of(work, typeof(*pw), base);
1987+
1988+
if (pw->trampoline)
1989+
i915_active_release(&pw->trampoline->active);
1990+
i915_active_release(&pw->shadow->active);
1991+
i915_active_release(&pw->batch->active);
1992+
}
1993+
19841994
static const struct dma_fence_work_ops eb_parse_ops = {
19851995
.name = "eb_parse",
19861996
.work = __eb_parse,
1997+
.release = __eb_parse_release,
19871998
};
19881999

19892000
static int eb_parse_pipeline(struct i915_execbuffer *eb,
@@ -1997,6 +2008,20 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,
19972008
if (!pw)
19982009
return -ENOMEM;
19992010

2011+
err = i915_active_acquire(&eb->batch->active);
2012+
if (err)
2013+
goto err_free;
2014+
2015+
err = i915_active_acquire(&shadow->active);
2016+
if (err)
2017+
goto err_batch;
2018+
2019+
if (trampoline) {
2020+
err = i915_active_acquire(&trampoline->active);
2021+
if (err)
2022+
goto err_shadow;
2023+
}
2024+
20002025
dma_fence_work_init(&pw->base, &eb_parse_ops);
20012026

20022027
pw->engine = eb->engine;
@@ -2006,7 +2031,9 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,
20062031
pw->shadow = shadow;
20072032
pw->trampoline = trampoline;
20082033

2009-
dma_resv_lock(pw->batch->resv, NULL);
2034+
err = dma_resv_lock_interruptible(pw->batch->resv, NULL);
2035+
if (err)
2036+
goto err_trampoline;
20102037

20112038
err = dma_resv_reserve_shared(pw->batch->resv, 1);
20122039
if (err)
@@ -2034,6 +2061,14 @@ static int eb_parse_pipeline(struct i915_execbuffer *eb,
20342061

20352062
err_batch_unlock:
20362063
dma_resv_unlock(pw->batch->resv);
2064+
err_trampoline:
2065+
if (trampoline)
2066+
i915_active_release(&trampoline->active);
2067+
err_shadow:
2068+
i915_active_release(&shadow->active);
2069+
err_batch:
2070+
i915_active_release(&eb->batch->active);
2071+
err_free:
20372072
kfree(pw);
20382073
return err;
20392074
}

0 commit comments

Comments
 (0)