diff options
author | Dave Airlie <airlied@redhat.com> | 2014-02-20 01:22:25 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-02-20 01:22:25 -0500 |
commit | 5d7aad03c80f568dc8515f349956ae6644f3bf8f (patch) | |
tree | 70b509145cd3a4f77d919ae55815c5105fdec768 | |
parent | 75936c65dda54a08d9124f24f8725f86a4adc286 (diff) | |
parent | b18915379071b31ea819a36ca67761620decba06 (diff) |
Merge tag 'drm/for-3.14-rc3' of git://anongit.freedesktop.org/tegra/linux into drm-fixes
drm/tegra: Fixes for v3.14-rc3
These patches contain a fix for a potential hang when the RGB output is
disabled twice, a typofix that prevents the framebuffer console from
being restored on ->lastclose() and an optimization to do as little work
as possible during host1x job submission.
* tag 'drm/for-3.14-rc3' of git://anongit.freedesktop.org/tegra/linux:
drm/tegra: Add guard to avoid double disable/enable of RGB outputs
gpu: host1x: do not check previously handled gathers
drm/tegra: fix typo 'CONFIG_TEGRA_DRM_FBDEV'
-rw-r--r-- | drivers/gpu/drm/tegra/drm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/tegra/rgb.c | 11 | ||||
-rw-r--r-- | drivers/gpu/host1x/job.c | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 88a529008ce0..c71594754f46 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c | |||
@@ -104,7 +104,7 @@ static void tegra_drm_context_free(struct tegra_drm_context *context) | |||
104 | 104 | ||
105 | static void tegra_drm_lastclose(struct drm_device *drm) | 105 | static void tegra_drm_lastclose(struct drm_device *drm) |
106 | { | 106 | { |
107 | #ifdef CONFIG_TEGRA_DRM_FBDEV | 107 | #ifdef CONFIG_DRM_TEGRA_FBDEV |
108 | struct tegra_drm *tegra = drm->dev_private; | 108 | struct tegra_drm *tegra = drm->dev_private; |
109 | 109 | ||
110 | tegra_fbdev_restore_mode(tegra->fbdev); | 110 | tegra_fbdev_restore_mode(tegra->fbdev); |
diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c index 338f7f6561d7..0266fb40479e 100644 --- a/drivers/gpu/drm/tegra/rgb.c +++ b/drivers/gpu/drm/tegra/rgb.c | |||
@@ -15,6 +15,7 @@ | |||
15 | struct tegra_rgb { | 15 | struct tegra_rgb { |
16 | struct tegra_output output; | 16 | struct tegra_output output; |
17 | struct tegra_dc *dc; | 17 | struct tegra_dc *dc; |
18 | bool enabled; | ||
18 | 19 | ||
19 | struct clk *clk_parent; | 20 | struct clk *clk_parent; |
20 | struct clk *clk; | 21 | struct clk *clk; |
@@ -89,6 +90,9 @@ static int tegra_output_rgb_enable(struct tegra_output *output) | |||
89 | struct tegra_rgb *rgb = to_rgb(output); | 90 | struct tegra_rgb *rgb = to_rgb(output); |
90 | unsigned long value; | 91 | unsigned long value; |
91 | 92 | ||
93 | if (rgb->enabled) | ||
94 | return 0; | ||
95 | |||
92 | tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable)); | 96 | tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable)); |
93 | 97 | ||
94 | value = DE_SELECT_ACTIVE | DE_CONTROL_NORMAL; | 98 | value = DE_SELECT_ACTIVE | DE_CONTROL_NORMAL; |
@@ -122,6 +126,8 @@ static int tegra_output_rgb_enable(struct tegra_output *output) | |||
122 | tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); | 126 | tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); |
123 | tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); | 127 | tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); |
124 | 128 | ||
129 | rgb->enabled = true; | ||
130 | |||
125 | return 0; | 131 | return 0; |
126 | } | 132 | } |
127 | 133 | ||
@@ -130,6 +136,9 @@ static int tegra_output_rgb_disable(struct tegra_output *output) | |||
130 | struct tegra_rgb *rgb = to_rgb(output); | 136 | struct tegra_rgb *rgb = to_rgb(output); |
131 | unsigned long value; | 137 | unsigned long value; |
132 | 138 | ||
139 | if (!rgb->enabled) | ||
140 | return 0; | ||
141 | |||
133 | value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_POWER_CONTROL); | 142 | value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_POWER_CONTROL); |
134 | value &= ~(PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE | | 143 | value &= ~(PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE | |
135 | PW4_ENABLE | PM0_ENABLE | PM1_ENABLE); | 144 | PW4_ENABLE | PM0_ENABLE | PM1_ENABLE); |
@@ -144,6 +153,8 @@ static int tegra_output_rgb_disable(struct tegra_output *output) | |||
144 | 153 | ||
145 | tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable)); | 154 | tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable)); |
146 | 155 | ||
156 | rgb->enabled = false; | ||
157 | |||
147 | return 0; | 158 | return 0; |
148 | } | 159 | } |
149 | 160 | ||
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 1146e3bba6e1..112f27e51bc7 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c | |||
@@ -538,7 +538,7 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev) | |||
538 | 538 | ||
539 | g->base = job->gather_addr_phys[i]; | 539 | g->base = job->gather_addr_phys[i]; |
540 | 540 | ||
541 | for (j = 0; j < job->num_gathers; j++) | 541 | for (j = i + 1; j < job->num_gathers; j++) |
542 | if (job->gathers[j].bo == g->bo) | 542 | if (job->gathers[j].bo == g->bo) |
543 | job->gathers[j].handled = true; | 543 | job->gathers[j].handled = true; |
544 | 544 | ||