History

Merge tag 'drm-fixes-2019-04-26' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie: "Regular drm fixes, nothing too outstanding, I'm guessing Easter was slowing people down. i915: - FEC enable fix - BXT display lanes fix ttm: - fix reinit for reloading drivers regression imx: - DP CSC fix sun4i: - module unload/load fix vc4: - memory leak fix - compile fix dw-hdmi: - rockchip scdc overflow fix sched: - docs fix vmwgfx: - dma api layering fix" * tag 'drm-fixes-2019-04-26' of git://anongit.freedesktop.org/drm/drm: drm/bridge: dw-hdmi: fix SCDC configuration for ddc-i2c-bus drm/vmwgfx: Fix dma API layer violation drm/vc4: Fix compilation error reported by kbuild test bot drm/sun4i: Unbind components before releasing DRM and memory drm/vc4: Fix memory leak during gpu reset. drm/sched: Fix description of drm_sched_stop drm/imx: don't skip DP channel disable for background plane gpu: ipu-v3: dp: fix CSC handling drm/ttm: fix re-init of global structures drm/sun4i: Fix component unbinding and component master deletion drm/sun4i: Set device driver data at bind time for use in unbind drm/sun4i: Add missing drm_atomic_helper_shutdown at driver unbind drm/i915: Restore correct bxt_ddi_phy_calc_lane_lat_optim_mask() calculation drm/i915: Do not enable FEC without DSC drm: bridge: dw-hdmi: Fix overflow workaround for Rockchip SoCs

Linus Torvalds committed 7 years ago

Commit 4e40f0f2 parents d0473f9 6db71be12 files · +53 −52Browse files

Unified · Split

12 files
  1. drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +12 −4
  2. drivers/gpu/drm/i915/intel_ddi.c +4 −2
  3. drivers/gpu/drm/i915/intel_dp.c +3 −3
  4. drivers/gpu/drm/imx/ipuv3-crtc.c +1 −1
  5. drivers/gpu/drm/scheduler/sched_main.c +1 −2
  6. drivers/gpu/drm/sun4i/sun4i_drv.c +9 −0
  7. drivers/gpu/drm/ttm/ttm_bo.c +5 −5
  8. drivers/gpu/drm/ttm/ttm_memory.c +3 −2
  9. drivers/gpu/drm/vc4/vc4_crtc.c +1 −1
  10. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +5 −28
  11. drivers/gpu/ipu-v3/ipu-dp.c +9 −3
  12. include/drm/ttm/ttm_bo_driver.h +0 −1
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c+12−4
@@ -1046,6 +1046,10 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi) · 1045 unmodified lines
10461046 if (hdmi->version < 0x200a)
10471047 return false;
10481048
1049+ /* Disable if no DDC bus */
1050+ if (!hdmi->ddc)
1051+ return false;
1052+
10491053 /* Disable if SCDC is not supported, or if an HF-VSDB block is absent */
10501054 if (!display->hdmi.scdc.supported ||
10511055 !display->hdmi.scdc.scrambling.supported)
@@ -1684,13 +1688,13 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, · 632 unmodified lines
16841688 * Source Devices compliant shall set the
16851689 * Source Version = 1.
16861690 */
1687− drm_scdc_readb(&hdmi->i2c->adap, SCDC_SINK_VERSION,
1691+ drm_scdc_readb(hdmi->ddc, SCDC_SINK_VERSION,
16881692 &bytes);
1689− drm_scdc_writeb(&hdmi->i2c->adap, SCDC_SOURCE_VERSION,
1693+ drm_scdc_writeb(hdmi->ddc, SCDC_SOURCE_VERSION,
16901694 min_t(u8, bytes, SCDC_MIN_SOURCE_VERSION));
16911695
16921696 /* Enabled Scrambling in the Sink */
1693− drm_scdc_set_scrambling(&hdmi->i2c->adap, 1);
1697+ drm_scdc_set_scrambling(hdmi->ddc, 1);
16941698
16951699 /*
16961700 * To activate the scrambler feature, you must ensure
@@ -1706,7 +1710,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, · 9 unmodified lines
17061710 hdmi_writeb(hdmi, 0, HDMI_FC_SCRAMBLER_CTRL);
17071711 hdmi_writeb(hdmi, (u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ,
17081712 HDMI_MC_SWRSTZ);
1709− drm_scdc_set_scrambling(&hdmi->i2c->adap, 0);
1713+ drm_scdc_set_scrambling(hdmi->ddc, 0);
17101714 }
17111715 }
17121716
@@ -1800,6 +1804,8 @@ static void dw_hdmi_clear_overflow(struct dw_hdmi *hdmi) · 87 unmodified lines
18001804 * iteration for others.
18011805 * The Amlogic Meson GX SoCs (v2.01a) have been identified as needing
18021806 * the workaround with a single iteration.
1807+ * The Rockchip RK3288 SoC (v2.00a) and RK3328/RK3399 SoCs (v2.11a) have
1808+ * been identified as needing the workaround with a single iteration.
18031809 */
18041810
18051811 switch (hdmi->version) {
@@ -1808,7 +1814,9 @@ static void dw_hdmi_clear_overflow(struct dw_hdmi *hdmi) · 2 unmodified lines
18081814 break;
18091815 case 0x131a:
18101816 case 0x132a:
1817+ case 0x200a:
18111818 case 0x201a:
1819+ case 0x211a:
18121820 case 0x212a:
18131821 count = 1;
18141822 break;
drivers/gpu/drm/i915/intel_ddi.c+4−2
@@ -3862,14 +3862,16 @@ static int intel_ddi_compute_config(struct intel_encoder *encoder, · 3861 unmodified lines
38623862 ret = intel_hdmi_compute_config(encoder, pipe_config, conn_state);
38633863 else
38643864 ret = intel_dp_compute_config(encoder, pipe_config, conn_state);
3865+ if (ret)
3866+ return ret;
38653867
3866− if (IS_GEN9_LP(dev_priv) && ret)
3868+ if (IS_GEN9_LP(dev_priv))
38673869 pipe_config->lane_lat_optim_mask =
38683870 bxt_ddi_phy_calc_lane_lat_optim_mask(pipe_config->lane_count);
38693871
38703872 intel_ddi_compute_min_voltage_level(dev_priv, pipe_config);
38713873
3872− return ret;
3874+ return 0;
38733875
38743876 }
38753877
drivers/gpu/drm/i915/intel_dp.c+3−3
@@ -1886,6 +1886,9 @@ static int intel_dp_dsc_compute_config(struct intel_dp *intel_dp, · 1885 unmodified lines
18861886 int pipe_bpp;
18871887 int ret;
18881888
1889+ pipe_config->fec_enable = !intel_dp_is_edp(intel_dp) &&
1890+ intel_dp_supports_fec(intel_dp, pipe_config);
1891+
18891892 if (!intel_dp_supports_dsc(intel_dp, pipe_config))
18901893 return -EINVAL;
18911894
@@ -2116,9 +2119,6 @@ intel_dp_compute_config(struct intel_encoder *encoder, · 224 unmodified lines
21162119 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLCLK)
21172120 return -EINVAL;
21182121
2119− pipe_config->fec_enable = !intel_dp_is_edp(intel_dp) &&
2120− intel_dp_supports_fec(intel_dp, pipe_config);
2121−
21222122 ret = intel_dp_compute_link_config(encoder, pipe_config, conn_state);
21232123 if (ret < 0)
21242124 return ret;
drivers/gpu/drm/imx/ipuv3-crtc.c+1−1
@@ -71,7 +71,7 @@ static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc, · 70 unmodified lines
7171 if (disable_partial)
7272 ipu_plane_disable(ipu_crtc->plane[1], true);
7373 if (disable_full)
74− ipu_plane_disable(ipu_crtc->plane[0], false);
74+ ipu_plane_disable(ipu_crtc->plane[0], true);
7575 }
7676
7777 static void ipu_crtc_atomic_disable(struct drm_crtc *crtc,
drivers/gpu/drm/scheduler/sched_main.c+1−2
@@ -366,10 +366,9 @@ void drm_sched_increase_karma(struct drm_sched_job *bad) · 365 unmodified lines
366366 EXPORT_SYMBOL(drm_sched_increase_karma);
367367
368368 /**
369− * drm_sched_hw_job_reset - stop the scheduler if it contains the bad job
369+ * drm_sched_stop - stop the scheduler
370370 *
371371 * @sched: scheduler instance
372− * @bad: bad scheduler job
373372 *
374373 */
375374 void drm_sched_stop(struct drm_gpu_scheduler *sched)
drivers/gpu/drm/sun4i/sun4i_drv.c+9−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/of_reserved_mem.h>
1717
1818 #include <drm/drmP.h>
19+#include <drm/drm_atomic_helper.h>
1920 #include <drm/drm_fb_cma_helper.h>
2021 #include <drm/drm_fb_helper.h>
2122 #include <drm/drm_gem_cma_helper.h>
@@ -85,6 +86,8 @@ static int sun4i_drv_bind(struct device *dev) · 63 unmodified lines
8586 ret = -ENOMEM;
8687 goto free_drm;
8788 }
89+
90+ dev_set_drvdata(dev, drm);
8891 drm->dev_private = drv;
8992 INIT_LIST_HEAD(&drv->frontend_list);
9093 INIT_LIST_HEAD(&drv->engine_list);
@@ -144,8 +147,12 @@ static void sun4i_drv_unbind(struct device *dev) · 53 unmodified lines
144147
145148 drm_dev_unregister(drm);
146149 drm_kms_helper_poll_fini(drm);
150+ drm_atomic_helper_shutdown(drm);
147151 drm_mode_config_cleanup(drm);
152+
153+ component_unbind_all(dev, NULL);
148154 of_reserved_mem_device_release(dev);
155+
149156 drm_dev_put(drm);
150157 }
151158
@@ -395,6 +402,8 @@ static int sun4i_drv_probe(struct platform_device *pdev) · 243 unmodified lines
395402
396403 static int sun4i_drv_remove(struct platform_device *pdev)
397404 {
405+ component_master_del(&pdev->dev, &sun4i_drv_master_ops);
406+
398407 return 0;
399408 }
400409
drivers/gpu/drm/ttm/ttm_bo.c+5−5
@@ -49,9 +49,8 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj); · 48 unmodified lines
4949 * ttm_global_mutex - protecting the global BO state
5050 */
5151 DEFINE_MUTEX(ttm_global_mutex);
52−struct ttm_bo_global ttm_bo_glob = {
53− .use_count = 0
54−};
52+unsigned ttm_bo_glob_use_count;
53+struct ttm_bo_global ttm_bo_glob;
5554
5655 static struct attribute ttm_bo_count = {
5756 .name = "bo_count",
@@ -1531,12 +1530,13 @@ static void ttm_bo_global_release(void) · 1473 unmodified lines
15311530 struct ttm_bo_global *glob = &ttm_bo_glob;
15321531
15331532 mutex_lock(&ttm_global_mutex);
1534− if (--glob->use_count > 0)
1533+ if (--ttm_bo_glob_use_count > 0)
15351534 goto out;
15361535
15371536 kobject_del(&glob->kobj);
15381537 kobject_put(&glob->kobj);
15391538 ttm_mem_global_release(&ttm_mem_glob);
1539+ memset(glob, 0, sizeof(*glob));
15401540 out:
15411541 mutex_unlock(&ttm_global_mutex);
15421542 }
@@ -1548,7 +1548,7 @@ static int ttm_bo_global_init(void) · 5 unmodified lines
15481548 unsigned i;
15491549
15501550 mutex_lock(&ttm_global_mutex);
1551− if (++glob->use_count > 1)
1551+ if (++ttm_bo_glob_use_count > 1)
15521552 goto out;
15531553
15541554 ret = ttm_mem_global_init(&ttm_mem_glob);
drivers/gpu/drm/ttm/ttm_memory.c+3−2
@@ -461,8 +461,8 @@ out_no_zone: · 460 unmodified lines
461461
462462 void ttm_mem_global_release(struct ttm_mem_global *glob)
463463 {
464− unsigned int i;
465464 struct ttm_mem_zone *zone;
465+ unsigned int i;
466466
467467 /* let the page allocator first stop the shrink work. */
468468 ttm_page_alloc_fini();
@@ -475,9 +475,10 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) · 6 unmodified lines
475475 zone = glob->zones[i];
476476 kobject_del(&zone->kobj);
477477 kobject_put(&zone->kobj);
478− }
478+ }
479479 kobject_del(&glob->kobj);
480480 kobject_put(&glob->kobj);
481+ memset(glob, 0, sizeof(*glob));
481482 }
482483
483484 static void ttm_check_swapping(struct ttm_mem_global *glob)
drivers/gpu/drm/vc4/vc4_crtc.c+1−1
@@ -1042,7 +1042,7 @@ static void · 1041 unmodified lines
10421042 vc4_crtc_reset(struct drm_crtc *crtc)
10431043 {
10441044 if (crtc->state)
1045− __drm_atomic_helper_crtc_destroy_state(crtc->state);
1045+ vc4_crtc_destroy_state(crtc, crtc->state);
10461046
10471047 crtc->state = kzalloc(sizeof(struct vc4_crtc_state), GFP_KERNEL);
10481048 if (crtc->state)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+5−28
@@ -545,30 +545,14 @@ static void vmw_get_initial_size(struct vmw_private *dev_priv) · 544 unmodified lines
545545 dev_priv->initial_height = height;
546546 }
547547
548−/**
549− * vmw_assume_iommu - Figure out whether coherent dma-remapping might be
550− * taking place.
551− * @dev: Pointer to the struct drm_device.
552− *
553− * Return: true if iommu present, false otherwise.
554− */
555−static bool vmw_assume_iommu(struct drm_device *dev)
556−{
557− const struct dma_map_ops *ops = get_dma_ops(dev->dev);
558−
559− return !dma_is_direct(ops) && ops &&
560− ops->map_page != dma_direct_map_page;
561−}
562−
563548 /**
564549 * vmw_dma_select_mode - Determine how DMA mappings should be set up for this
565550 * system.
566551 *
567552 * @dev_priv: Pointer to a struct vmw_private
568553 *
569− * This functions tries to determine the IOMMU setup and what actions
570− * need to be taken by the driver to make system pages visible to the
571− * device.
554+ * This functions tries to determine what actions need to be taken by the
555+ * driver to make system pages visible to the device.
572556 * If this function decides that DMA is not possible, it returns -EINVAL.
573557 * The driver may then try to disable features of the device that require
574558 * DMA.
@@ -578,23 +562,16 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv) · 3 unmodified lines
578562 static const char *names[vmw_dma_map_max] = {
579563 [vmw_dma_phys] = "Using physical TTM page addresses.",
580564 [vmw_dma_alloc_coherent] = "Using coherent TTM pages.",
581− [vmw_dma_map_populate] = "Keeping DMA mappings.",
565+ [vmw_dma_map_populate] = "Caching DMA mappings.",
582566 [vmw_dma_map_bind] = "Giving up DMA mappings early."};
583567
584568 if (vmw_force_coherent)
585569 dev_priv->map_mode = vmw_dma_alloc_coherent;
586− else if (vmw_assume_iommu(dev_priv->dev))
587− dev_priv->map_mode = vmw_dma_map_populate;
588− else if (!vmw_force_iommu)
589− dev_priv->map_mode = vmw_dma_phys;
590− else if (IS_ENABLED(CONFIG_SWIOTLB) && swiotlb_nr_tbl())
591− dev_priv->map_mode = vmw_dma_alloc_coherent;
570+ else if (vmw_restrict_iommu)
571+ dev_priv->map_mode = vmw_dma_map_bind;
592572 else
593573 dev_priv->map_mode = vmw_dma_map_populate;
594574
595− if (dev_priv->map_mode == vmw_dma_map_populate && vmw_restrict_iommu)
596− dev_priv->map_mode = vmw_dma_map_bind;
597−
598575 /* No TTM coherent page pool? FIXME: Ask TTM instead! */
599576 if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) &&
600577 (dev_priv->map_mode == vmw_dma_alloc_coherent))
drivers/gpu/ipu-v3/ipu-dp.c+9−3
@@ -195,7 +195,8 @@ int ipu_dp_setup_channel(struct ipu_dp *dp, · 194 unmodified lines
195195 ipu_dp_csc_init(flow, flow->foreground.in_cs, flow->out_cs,
196196 DP_COM_CONF_CSC_DEF_BOTH);
197197 } else {
198− if (flow->foreground.in_cs == flow->out_cs)
198+ if (flow->foreground.in_cs == IPUV3_COLORSPACE_UNKNOWN ||
199+ flow->foreground.in_cs == flow->out_cs)
199200 /*
200201 * foreground identical to output, apply color
201202 * conversion on background
@@ -261,6 +262,8 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync) · 59 unmodified lines
261262 struct ipu_dp_priv *priv = flow->priv;
262263 u32 reg, csc;
263264
265+ dp->in_cs = IPUV3_COLORSPACE_UNKNOWN;
266+
264267 if (!dp->foreground)
265268 return;
266269
@@ -268,8 +271,9 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync) · 1 unmodified line
268271
269272 reg = readl(flow->base + DP_COM_CONF);
270273 csc = reg & DP_COM_CONF_CSC_DEF_MASK;
271− if (csc == DP_COM_CONF_CSC_DEF_FG)
272− reg &= ~DP_COM_CONF_CSC_DEF_MASK;
274+ reg &= ~DP_COM_CONF_CSC_DEF_MASK;
275+ if (csc == DP_COM_CONF_CSC_DEF_BOTH || csc == DP_COM_CONF_CSC_DEF_BG)
276+ reg |= DP_COM_CONF_CSC_DEF_BG;
273277
274278 reg &= ~DP_COM_CONF_FG_EN;
275279 writel(reg, flow->base + DP_COM_CONF);
@@ -347,6 +351,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base) · 71 unmodified lines
347351 mutex_init(&priv->mutex);
348352
349353 for (i = 0; i < IPUV3_NUM_FLOWS; i++) {
354+ priv->flow[i].background.in_cs = IPUV3_COLORSPACE_UNKNOWN;
355+ priv->flow[i].foreground.in_cs = IPUV3_COLORSPACE_UNKNOWN;
350356 priv->flow[i].foreground.foreground = true;
351357 priv->flow[i].base = priv->base + ipu_dp_flow_base[i];
352358 priv->flow[i].priv = priv;
include/drm/ttm/ttm_bo_driver.h+0−1
@@ -420,7 +420,6 @@ extern struct ttm_bo_global { · 419 unmodified lines
420420 /**
421421 * Protected by ttm_global_mutex.
422422 */
423− unsigned int use_count;
424423 struct list_head device_list;
425424
426425 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t