Commit 5d7aad03 authored by Dave Airlie's avatar Dave Airlie

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'
parents 75936c65 b1891537
...@@ -104,7 +104,7 @@ static void tegra_drm_context_free(struct tegra_drm_context *context) ...@@ -104,7 +104,7 @@ static void tegra_drm_context_free(struct tegra_drm_context *context)
static void tegra_drm_lastclose(struct drm_device *drm) static void tegra_drm_lastclose(struct drm_device *drm)
{ {
#ifdef CONFIG_TEGRA_DRM_FBDEV #ifdef CONFIG_DRM_TEGRA_FBDEV
struct tegra_drm *tegra = drm->dev_private; struct tegra_drm *tegra = drm->dev_private;
tegra_fbdev_restore_mode(tegra->fbdev); tegra_fbdev_restore_mode(tegra->fbdev);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
struct tegra_rgb { struct tegra_rgb {
struct tegra_output output; struct tegra_output output;
struct tegra_dc *dc; struct tegra_dc *dc;
bool enabled;
struct clk *clk_parent; struct clk *clk_parent;
struct clk *clk; struct clk *clk;
...@@ -89,6 +90,9 @@ static int tegra_output_rgb_enable(struct tegra_output *output) ...@@ -89,6 +90,9 @@ static int tegra_output_rgb_enable(struct tegra_output *output)
struct tegra_rgb *rgb = to_rgb(output); struct tegra_rgb *rgb = to_rgb(output);
unsigned long value; unsigned long value;
if (rgb->enabled)
return 0;
tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable)); tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable));
value = DE_SELECT_ACTIVE | DE_CONTROL_NORMAL; value = DE_SELECT_ACTIVE | DE_CONTROL_NORMAL;
...@@ -122,6 +126,8 @@ static int tegra_output_rgb_enable(struct tegra_output *output) ...@@ -122,6 +126,8 @@ static int tegra_output_rgb_enable(struct tegra_output *output)
tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL);
tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); tegra_dc_writel(rgb->dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL);
rgb->enabled = true;
return 0; return 0;
} }
...@@ -130,6 +136,9 @@ static int tegra_output_rgb_disable(struct tegra_output *output) ...@@ -130,6 +136,9 @@ static int tegra_output_rgb_disable(struct tegra_output *output)
struct tegra_rgb *rgb = to_rgb(output); struct tegra_rgb *rgb = to_rgb(output);
unsigned long value; unsigned long value;
if (!rgb->enabled)
return 0;
value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_POWER_CONTROL); value = tegra_dc_readl(rgb->dc, DC_CMD_DISPLAY_POWER_CONTROL);
value &= ~(PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE | value &= ~(PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE |
PW4_ENABLE | PM0_ENABLE | PM1_ENABLE); PW4_ENABLE | PM0_ENABLE | PM1_ENABLE);
...@@ -144,6 +153,8 @@ static int tegra_output_rgb_disable(struct tegra_output *output) ...@@ -144,6 +153,8 @@ static int tegra_output_rgb_disable(struct tegra_output *output)
tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable)); tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable));
rgb->enabled = false;
return 0; return 0;
} }
......
...@@ -538,7 +538,7 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev) ...@@ -538,7 +538,7 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev)
g->base = job->gather_addr_phys[i]; g->base = job->gather_addr_phys[i];
for (j = 0; j < job->num_gathers; j++) for (j = i + 1; j < job->num_gathers; j++)
if (job->gathers[j].bo == g->bo) if (job->gathers[j].bo == g->bo)
job->gathers[j].handled = true; job->gathers[j].handled = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment