Skip to content

Commit 042c0bd

Browse files
committed
drm/tegra: dc: Parameterize maximum resolution
Tegra186 and later support a higher maximum resolution than earlier chips, so make sure to reflect that in the mode configuration. Signed-off-by: Thierry Reding <[email protected]>
1 parent 86044e7 commit 042c0bd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

drivers/gpu/drm/tegra/dc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,12 @@ static int tegra_dc_init(struct host1x_client *client)
21172117
if (dc->soc->pitch_align > tegra->pitch_align)
21182118
tegra->pitch_align = dc->soc->pitch_align;
21192119

2120+
/* track maximum resolution */
2121+
if (dc->soc->has_nvdisplay)
2122+
drm->mode_config.max_width = drm->mode_config.max_height = 16384;
2123+
else
2124+
drm->mode_config.max_width = drm->mode_config.max_height = 4096;
2125+
21202126
err = tegra_dc_rgb_init(drm, dc);
21212127
if (err < 0 && err != -ENODEV) {
21222128
dev_err(dc->dev, "failed to initialize RGB output: %d\n", err);

drivers/gpu/drm/tegra/drm.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,9 +1121,8 @@ static int host1x_drm_probe(struct host1x_device *dev)
11211121

11221122
drm->mode_config.min_width = 0;
11231123
drm->mode_config.min_height = 0;
1124-
1125-
drm->mode_config.max_width = 4096;
1126-
drm->mode_config.max_height = 4096;
1124+
drm->mode_config.max_width = 0;
1125+
drm->mode_config.max_height = 0;
11271126

11281127
drm->mode_config.allow_fb_modifiers = true;
11291128

@@ -1142,6 +1141,14 @@ static int host1x_drm_probe(struct host1x_device *dev)
11421141
if (err < 0)
11431142
goto fbdev;
11441143

1144+
/*
1145+
* Now that all display controller have been initialized, the maximum
1146+
* supported resolution is known and the bitmask for horizontal and
1147+
* vertical bitfields can be computed.
1148+
*/
1149+
tegra->hmask = drm->mode_config.max_width - 1;
1150+
tegra->vmask = drm->mode_config.max_height - 1;
1151+
11451152
if (tegra->use_explicit_iommu) {
11461153
u64 carveout_start, carveout_end, gem_start, gem_end;
11471154
u64 dma_mask = dma_get_mask(&dev->dev);

drivers/gpu/drm/tegra/drm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ struct tegra_drm {
5454
struct tegra_fbdev *fbdev;
5555
#endif
5656

57+
unsigned int hmask, vmask;
5758
unsigned int pitch_align;
5859

5960
struct tegra_display_hub *hub;

0 commit comments

Comments
 (0)