aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tegra
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-01-28 21:03:56 -0500
committerDave Airlie <airlied@redhat.com>2014-01-28 21:03:56 -0500
commit45ab1e07808585c645bc82afd7487a91390f5511 (patch)
treef8585ff6fdd6dcae6a08f13017cc1fc1a1b11ea7 /drivers/gpu/drm/tegra
parentf4b4718b61d1d5a7442a4fd6863ea80c3a10e508 (diff)
parent13411ddd319057ae334a4084ebcf2c741b317f34 (diff)
Merge tag 'drm/for-3.14-rc1-20140123' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v3.14-rc1 (update) These patches fix some issues caused by the DRM panel support from the previous pull request and add two more panels (for the Toshiba AC100 as well as the Seaboard and Ventana). * tag 'drm/for-3.14-rc1-20140123' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: Obtain head number from DT drm/panel: update EDID BLOB in panel_simple_get_modes() gpu: host1x: Remove unnecessary include drm/tegra: Use proper data type drm/tegra: Clarify how panel modes override others drm/tegra: Fix possible CRTC mask for RGB outputs drm/i915: Use drm_encoder_crtc_ok() drm: Move drm_encoder_crtc_ok() to core drm: provide a helper for the encoder possible_crtcs mask drm/tegra: Don't check resource with devm_ioremap_resource() drm/panel: Add support for Chunghwa CLAA101WA01A panel drm/panel: Add support for Samsung LTN101NT05 panel
Diffstat (limited to 'drivers/gpu/drm/tegra')
-rw-r--r--drivers/gpu/drm/tegra/dc.c41
-rw-r--r--drivers/gpu/drm/tegra/hdmi.c3
-rw-r--r--drivers/gpu/drm/tegra/output.c7
-rw-r--r--drivers/gpu/drm/tegra/rgb.c2
4 files changed, 45 insertions, 8 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 386f3b4b0094..9336006b475d 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1100,8 +1100,6 @@ static int tegra_dc_init(struct host1x_client *client)
1100 struct tegra_dc *dc = host1x_client_to_dc(client); 1100 struct tegra_dc *dc = host1x_client_to_dc(client);
1101 int err; 1101 int err;
1102 1102
1103 dc->pipe = tegra->drm->mode_config.num_crtc;
1104
1105 drm_crtc_init(tegra->drm, &dc->base, &tegra_crtc_funcs); 1103 drm_crtc_init(tegra->drm, &dc->base, &tegra_crtc_funcs);
1106 drm_mode_crtc_set_gamma_size(&dc->base, 256); 1104 drm_mode_crtc_set_gamma_size(&dc->base, 256);
1107 drm_crtc_helper_add(&dc->base, &tegra_crtc_helper_funcs); 1105 drm_crtc_helper_add(&dc->base, &tegra_crtc_helper_funcs);
@@ -1187,6 +1185,41 @@ static const struct of_device_id tegra_dc_of_match[] = {
1187 } 1185 }
1188}; 1186};
1189 1187
1188static int tegra_dc_parse_dt(struct tegra_dc *dc)
1189{
1190 struct device_node *np;
1191 u32 value = 0;
1192 int err;
1193
1194 err = of_property_read_u32(dc->dev->of_node, "nvidia,head", &value);
1195 if (err < 0) {
1196 dev_err(dc->dev, "missing \"nvidia,head\" property\n");
1197
1198 /*
1199 * If the nvidia,head property isn't present, try to find the
1200 * correct head number by looking up the position of this
1201 * display controller's node within the device tree. Assuming
1202 * that the nodes are ordered properly in the DTS file and
1203 * that the translation into a flattened device tree blob
1204 * preserves that ordering this will actually yield the right
1205 * head number.
1206 *
1207 * If those assumptions don't hold, this will still work for
1208 * cases where only a single display controller is used.
1209 */
1210 for_each_matching_node(np, tegra_dc_of_match) {
1211 if (np == dc->dev->of_node)
1212 break;
1213
1214 value++;
1215 }
1216 }
1217
1218 dc->pipe = value;
1219
1220 return 0;
1221}
1222
1190static int tegra_dc_probe(struct platform_device *pdev) 1223static int tegra_dc_probe(struct platform_device *pdev)
1191{ 1224{
1192 const struct of_device_id *id; 1225 const struct of_device_id *id;
@@ -1207,6 +1240,10 @@ static int tegra_dc_probe(struct platform_device *pdev)
1207 dc->dev = &pdev->dev; 1240 dc->dev = &pdev->dev;
1208 dc->soc = id->data; 1241 dc->soc = id->data;
1209 1242
1243 err = tegra_dc_parse_dt(dc);
1244 if (err < 0)
1245 return err;
1246
1210 dc->clk = devm_clk_get(&pdev->dev, NULL); 1247 dc->clk = devm_clk_get(&pdev->dev, NULL);
1211 if (IS_ERR(dc->clk)) { 1248 if (IS_ERR(dc->clk)) {
1212 dev_err(&pdev->dev, "failed to get clock\n"); 1249 dev_err(&pdev->dev, "failed to get clock\n");
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index bc9cb1ac709b..6928015d11a4 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1418,9 +1418,6 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
1418 return err; 1418 return err;
1419 1419
1420 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1420 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1421 if (!regs)
1422 return -ENXIO;
1423
1424 hdmi->regs = devm_ioremap_resource(&pdev->dev, regs); 1421 hdmi->regs = devm_ioremap_resource(&pdev->dev, regs);
1425 if (IS_ERR(hdmi->regs)) 1422 if (IS_ERR(hdmi->regs))
1426 return PTR_ERR(hdmi->regs); 1423 return PTR_ERR(hdmi->regs);
diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
index f1b5030f55e3..57cecbd18ca8 100644
--- a/drivers/gpu/drm/tegra/output.c
+++ b/drivers/gpu/drm/tegra/output.c
@@ -18,6 +18,10 @@ static int tegra_connector_get_modes(struct drm_connector *connector)
18 struct edid *edid = NULL; 18 struct edid *edid = NULL;
19 int err = 0; 19 int err = 0;
20 20
21 /*
22 * If the panel provides one or more modes, use them exclusively and
23 * ignore any other means of obtaining a mode.
24 */
21 if (output->panel) { 25 if (output->panel) {
22 err = output->panel->funcs->get_modes(output->panel); 26 err = output->panel->funcs->get_modes(output->panel);
23 if (err > 0) 27 if (err > 0)
@@ -187,8 +191,7 @@ int tegra_output_probe(struct tegra_output *output)
187{ 191{
188 struct device_node *ddc, *panel; 192 struct device_node *ddc, *panel;
189 enum of_gpio_flags flags; 193 enum of_gpio_flags flags;
190 size_t size; 194 int err, size;
191 int err;
192 195
193 if (!output->of_node) 196 if (!output->of_node)
194 output->of_node = output->dev->of_node; 197 output->of_node = output->dev->of_node;
diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c
index 03885bb8dcc0..338f7f6561d7 100644
--- a/drivers/gpu/drm/tegra/rgb.c
+++ b/drivers/gpu/drm/tegra/rgb.c
@@ -258,7 +258,7 @@ int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc)
258 * RGB outputs are an exception, so we make sure they can be attached 258 * RGB outputs are an exception, so we make sure they can be attached
259 * to only their parent display controller. 259 * to only their parent display controller.
260 */ 260 */
261 rgb->output.encoder.possible_crtcs = 1 << dc->pipe; 261 rgb->output.encoder.possible_crtcs = drm_crtc_mask(&dc->base);
262 262
263 return 0; 263 return 0;
264} 264}