Skip to content

Commit dada163

Browse files
committed
Merge tag 'drm-misc-fixes-2019-02-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
drm-misc-fixes for v5.0-rc6: - Fixes to omap/dsi encoder. - Clock fix for sun4i. - Licensing header fix for rockchip. - Fix division by zero in the mode when trying to set a mode on i915 with GVT-g enabled. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/84462cef-609f-e2af-084a-f9fe2b05c53e@linux.intel.com
2 parents 151e3d6 + 6297388 commit dada163

File tree

5 files changed

+24
-29
lines changed

5 files changed

+24
-29
lines changed

drivers/gpu/drm/drm_modes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ int drm_mode_hsync(const struct drm_display_mode *mode)
758758
if (mode->hsync)
759759
return mode->hsync;
760760

761-
if (mode->htotal < 0)
761+
if (mode->htotal <= 0)
762762
return 0;
763763

764764
calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */

drivers/gpu/drm/omapdrm/dss/dsi.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ static void dsi_pll_disable(struct dss_pll *pll)
14061406

14071407
static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
14081408
{
1409-
struct dsi_data *dsi = p;
1409+
struct dsi_data *dsi = s->private;
14101410
struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo;
14111411
enum dss_clk_source dispc_clk_src, dsi_clk_src;
14121412
int dsi_module = dsi->module_id;
@@ -1467,7 +1467,7 @@ static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
14671467
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
14681468
static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
14691469
{
1470-
struct dsi_data *dsi = p;
1470+
struct dsi_data *dsi = s->private;
14711471
unsigned long flags;
14721472
struct dsi_irq_stats stats;
14731473

@@ -1558,7 +1558,7 @@ static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
15581558

15591559
static int dsi_dump_dsi_regs(struct seq_file *s, void *p)
15601560
{
1561-
struct dsi_data *dsi = p;
1561+
struct dsi_data *dsi = s->private;
15621562

15631563
if (dsi_runtime_get(dsi))
15641564
return 0;
@@ -4751,6 +4751,17 @@ static int dsi_set_config(struct omap_dss_device *dssdev,
47514751
dsi->vm.flags |= DISPLAY_FLAGS_HSYNC_HIGH;
47524752
dsi->vm.flags &= ~DISPLAY_FLAGS_VSYNC_LOW;
47534753
dsi->vm.flags |= DISPLAY_FLAGS_VSYNC_HIGH;
4754+
/*
4755+
* HACK: These flags should be handled through the omap_dss_device bus
4756+
* flags, but this will only be possible when the DSI encoder will be
4757+
* converted to the omapdrm-managed encoder model.
4758+
*/
4759+
dsi->vm.flags &= ~DISPLAY_FLAGS_PIXDATA_NEGEDGE;
4760+
dsi->vm.flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE;
4761+
dsi->vm.flags &= ~DISPLAY_FLAGS_DE_LOW;
4762+
dsi->vm.flags |= DISPLAY_FLAGS_DE_HIGH;
4763+
dsi->vm.flags &= ~DISPLAY_FLAGS_SYNC_POSEDGE;
4764+
dsi->vm.flags |= DISPLAY_FLAGS_SYNC_NEGEDGE;
47544765

47554766
dss_mgr_set_timings(&dsi->output, &dsi->vm);
47564767

@@ -5083,15 +5094,15 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
50835094

50845095
snprintf(name, sizeof(name), "dsi%u_regs", dsi->module_id + 1);
50855096
dsi->debugfs.regs = dss_debugfs_create_file(dss, name,
5086-
dsi_dump_dsi_regs, &dsi);
5097+
dsi_dump_dsi_regs, dsi);
50875098
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
50885099
snprintf(name, sizeof(name), "dsi%u_irqs", dsi->module_id + 1);
50895100
dsi->debugfs.irqs = dss_debugfs_create_file(dss, name,
5090-
dsi_dump_dsi_irqs, &dsi);
5101+
dsi_dump_dsi_irqs, dsi);
50915102
#endif
50925103
snprintf(name, sizeof(name), "dsi%u_clks", dsi->module_id + 1);
50935104
dsi->debugfs.clks = dss_debugfs_create_file(dss, name,
5094-
dsi_dump_dsi_clocks, &dsi);
5105+
dsi_dump_dsi_clocks, dsi);
50955106

50965107
return 0;
50975108
}
@@ -5104,8 +5115,6 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data)
51045115
dss_debugfs_remove_file(dsi->debugfs.irqs);
51055116
dss_debugfs_remove_file(dsi->debugfs.regs);
51065117

5107-
of_platform_depopulate(dev);
5108-
51095118
WARN_ON(dsi->scp_clk_refcount > 0);
51105119

51115120
dss_pll_unregister(&dsi->pll);
@@ -5457,6 +5466,8 @@ static int dsi_remove(struct platform_device *pdev)
54575466

54585467
dsi_uninit_output(dsi);
54595468

5469+
of_platform_depopulate(&pdev->dev);
5470+
54605471
pm_runtime_disable(&pdev->dev);
54615472

54625473
if (dsi->vdds_dsi_reg != NULL && dsi->vdds_dsi_enabled) {

drivers/gpu/drm/rockchip/rockchip_rgb.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
//SPDX-License-Identifier: GPL-2.0+
1+
// SPDX-License-Identifier: GPL-2.0
22
/*
33
* Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
44
* Author:
55
* Sandy Huang <hjc@rock-chips.com>
6-
*
7-
* This software is licensed under the terms of the GNU General Public
8-
* License version 2, as published by the Free Software Foundation, and
9-
* may be copied, distributed, and modified under those terms.
10-
*
11-
* This program is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* GNU General Public License for more details.
156
*/
167

178
#include <drm/drmP.h>

drivers/gpu/drm/rockchip/rockchip_rgb.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
//SPDX-License-Identifier: GPL-2.0+
1+
/* SPDX-License-Identifier: GPL-2.0 */
22
/*
33
* Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
44
* Author:
55
* Sandy Huang <hjc@rock-chips.com>
6-
*
7-
* This software is licensed under the terms of the GNU General Public
8-
* License version 2, as published by the Free Software Foundation, and
9-
* may be copied, distributed, and modified under those terms.
10-
*
11-
* This program is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* GNU General Public License for more details.
156
*/
167

178
#ifdef CONFIG_ROCKCHIP_RGB

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ static int sun4i_tcon_init_clocks(struct device *dev,
761761
return PTR_ERR(tcon->sclk0);
762762
}
763763
}
764+
clk_prepare_enable(tcon->sclk0);
764765

765766
if (tcon->quirks->has_channel_1) {
766767
tcon->sclk1 = devm_clk_get(dev, "tcon-ch1");
@@ -775,6 +776,7 @@ static int sun4i_tcon_init_clocks(struct device *dev,
775776

776777
static void sun4i_tcon_free_clocks(struct sun4i_tcon *tcon)
777778
{
779+
clk_disable_unprepare(tcon->sclk0);
778780
clk_disable_unprepare(tcon->clk);
779781
}
780782

0 commit comments

Comments
 (0)