drm/tegra: dc: Do not register DC without primary plane
PATCH 1/5 drm/tegra: dc: Do not register DC without primary plane
From: Thierry Reding <[email protected]>
Tegra194 contains a fourth display controller that does not own any windows. Therefore, we cannot currently assign a primary plane to it which causes KMS to eventually crash. Do not register the display controller if it owns no windows to work around this.
Note that we still have to enable and probe the display controller because for some reason all display controllers need to be powered (and/or clocked) before any registers can be accessed in any of the display controllers.
--- drivers/gpu/drm/tegra/dc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/gpu/drm/tegra/dc.c +22 -0
@@ -1988,6 +1988,28 @@ static int tegra_dc_init(struct host1x_client *client)struct drm_plane *cursor =NULL ;int err; +/* +* XXX do not register DCs with no window groups because we cannot +* assign a primary plane to them, which in turn will cause KMS to +* crash. +*/ +if (dc->soc->wgrps) { +bool has_wgrps = false; +unsigned int i; + +for (i =0 ; i < dc->soc->num_wgrps; i++) { +const struct tegra_windowgroup_soc *wgrp = &dc->soc->wgrps[i]; + +if (wgrp->dc == dc->pipe && wgrp->num_windows >0 ) { + has_wgrps = true; +break ; + } + } + +if (!has_wgrps) +return 0 ; + } + dc->syncpt =host1x_syncpt_request (client, flags);if (!dc->syncpt)dev_warn (dc->dev,"failed to allocate syncpoint\n" );
Signature · 6 lines
2.19.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/5 drm/tegra: hub: Add Tegra194 support
From: Thierry Reding <[email protected]>
The display hub integrated into Tegra194 is almost identical to the one found on Tegra186. However, it doesn't support DSC (display stream compression) so it isn't fully compatible.
--- drivers/gpu/drm/tegra/drm.c | 1 + drivers/gpu/drm/tegra/hub.c | 19 +++++++++++++++---- drivers/gpu/drm/tegra/hub.h | 1 + 3 files changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/tegra/drm.c +1 -0
@@ -1275,6 +1275,7 @@ static const struct of_device_id host1x_drm_subdevs[] = { { .compatible = "nvidia,tegra186-sor", }, { .compatible = "nvidia,tegra186-sor1", }, { .compatible = "nvidia,tegra186-vic", }, + { .compatible = "nvidia,tegra194-display", }, { /* sentinel */ } };
drivers/gpu/drm/tegra/hub.c +15 -4
@@ -758,10 +758,12 @@ static int tegra_display_hub_probe(struct platform_device *pdev)return err; } - hub->clk_dsc =devm_clk_get (&pdev->dev,"dsc" ); -if (IS_ERR (hub->clk_dsc)) { - err =PTR_ERR (hub->clk_dsc); -return err; +if (hub->soc->supports_dsc) { + hub->clk_dsc =devm_clk_get (&pdev->dev,"dsc" ); +if (IS_ERR (hub->clk_dsc)) { + err =PTR_ERR (hub->clk_dsc); +return err; + } } hub->clk_hub =devm_clk_get (&pdev->dev,"hub" );
@@ -890,10 +892,19 @@ static const struct dev_pm_ops tegra_display_hub_pm_ops = {static const struct tegra_display_hub_soc tegra186_display_hub = { .num_wgrps =6 , + .supports_dsc = true, +}; + +static const struct tegra_display_hub_soc tegra194_display_hub = { + .num_wgrps =6 , + .supports_dsc = false, };static const struct of_device_id tegra_display_hub_of_match[] = { { + .compatible ="nvidia,tegra194-display" , + .data = &tegra194_display_hub + }, { .compatible ="nvidia,tegra186-display" , .data = &tegra186_display_hub }, {
drivers/gpu/drm/tegra/hub.h +1 -0
@@ -38,6 +38,7 @@ to_tegra_shared_plane(struct drm_plane *plane)struct tegra_display_hub_soc {unsigned int num_wgrps; +bool supports_dsc; };struct tegra_display_hub {
Signature · 6 lines
2.19.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/5 drm/tegra: dc: Add Tegra194 support
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The display controllers found on Tegra194 are almost identical to those found on Tegra186.
--- drivers/gpu/drm/tegra/dc.c | 51 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/tegra/dc.h | 2 +- drivers/gpu/drm/tegra/drm.c | 1 + 3 files changed, 53 insertions(+), 1 deletion(-)
drivers/gpu/drm/tegra/dc.c +51 -0
@@ -2256,8 +2256,59 @@ static const struct tegra_dc_soc_info tegra186_dc_soc_info = { .num_wgrps = ARRAY_SIZE(tegra186_dc_wgrps), }; +static const struct tegra_windowgroup_soc tegra194_dc_wgrps[] = { + { + .index =0 , + .dc =0 , + .windows = (const unsigned int []) {0 }, + .num_windows =1 , + }, { + .index =1 , + .dc =1 , + .windows = (const unsigned int []) {1 }, + .num_windows =1 , + }, { + .index =2 , + .dc =1 , + .windows = (const unsigned int []) {2 }, + .num_windows =1 , + }, { + .index =3 , + .dc =2 , + .windows = (const unsigned int []) {3 }, + .num_windows =1 , + }, { + .index =4 , + .dc =2 , + .windows = (const unsigned int []) {4 }, + .num_windows =1 , + }, { + .index =5 , + .dc =2 , + .windows = (const unsigned int []) {5 }, + .num_windows =1 , + }, +}; + +static const struct tegra_dc_soc_info tegra194_dc_soc_info = { + .supports_background_color = true, + .supports_interlacing = true, + .supports_cursor = true, + .supports_block_linear = true, + .has_legacy_blending = false, + .pitch_align =64 , + .has_powergate = false, + .coupled_pm = false, + .has_nvdisplay = true, + .wgrps = tegra194_dc_wgrps, + .num_wgrps =ARRAY_SIZE (tegra194_dc_wgrps), +}; +static const struct of_device_id tegra_dc_of_match[] = { { + .compatible ="nvidia,tegra194-dc" , + .data = &tegra194_dc_soc_info, + }, { .compatible ="nvidia,tegra186-dc" , .data = &tegra186_dc_soc_info, }, {
drivers/gpu/drm/tegra/dc.h +1 -1
@@ -300,7 +300,7 @@ int tegra_dc_rgb_exit(struct tegra_dc *dc);#define SOR1_TIMING_CYA (1 << 27)#define CURSOR_ENABLE (1 << 16) -#define SOR_ENABLE (x) (1 << (25 + (x))) +#define SOR_ENABLE (x) (1 << (25 + (((x) > 1) ? ((x) + 1) : (x))))#define DC_DISP_DISP_MEM_HIGH_PRIORITY 0x403#define CURSOR_THRESHOLD (x) (((x) & 0x03) << 24)
drivers/gpu/drm/tegra/drm.c +1 -0
@@ -1276,6 +1276,7 @@ static const struct of_device_id host1x_drm_subdevs[] = { { .compatible = "nvidia,tegra186-sor1", }, { .compatible = "nvidia,tegra186-vic", }, { .compatible = "nvidia,tegra194-display", }, + { .compatible = "nvidia,tegra194-dc", }, { /* sentinel */ } };
Signature · 6 lines
2.19.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/5 drm/tegra: dpaux: Add Tegra194 support
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The DPAUX controller found on Tegra194 is almost identical to its predecessor from Tegra186.
--- drivers/gpu/drm/tegra/dpaux.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/tegra/dpaux.c +1 -0
@@ -639,6 +639,7 @@ static const struct dev_pm_ops tegra_dpaux_pm_ops = { };static const struct of_device_id tegra_dpaux_of_match[] = { + { .compatible ="nvidia,tegra194-dpaux" , }, { .compatible ="nvidia,tegra186-dpaux" , }, { .compatible ="nvidia,tegra210-dpaux" , }, { .compatible ="nvidia,tegra124-dpaux" , },
Signature · 6 lines
2.19.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/5 drm/tegra: sor: Add Tegra194 support
In reply to Thierry RedingFrom: Thierry Reding <[email protected]>
The SOR implemented in Tegra194 is subtly different from its predecessor found in Tegra186. Most notably some registers have been moved around so it is no longer compatible.
--- drivers/gpu/drm/tegra/drm.c | 1 + drivers/gpu/drm/tegra/sor.c | 110 ++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+)
drivers/gpu/drm/tegra/drm.c +1 -0
@@ -1277,6 +1277,7 @@ static const struct of_device_id host1x_drm_subdevs[] = { { .compatible = "nvidia,tegra186-vic", }, { .compatible = "nvidia,tegra194-display", }, { .compatible = "nvidia,tegra194-dc", }, + { .compatible = "nvidia,tegra194-sor", }, { /* sentinel */ } };
drivers/gpu/drm/tegra/sor.c +110 -0
123 lines not on this page · raw message
Signature · 6 lines
2.19.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel