Re: [PATCH 2/2] drm/tegra: Obtain head number from DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 01/13/2014 07:21 AM, Thierry Reding wrote:
> The head number of a given display controller is fixed in hardware and
> required to program outputs appropriately. Relying on the driver probe
> order to determine this number will not work, since that could yield a
> situation where the second head was probed first and would be assigned
> head number 0 instead of 1.

This change makes the new properties mandatory, yet they aren't part of
the DT files yet. So, won't this patch break all display on Tegra?

To avoid having to modify the Tegra DTs in this patch, can't the code
fall back to the existing broken algorithm if the property is missing, i.e.:

> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c

> -	dc->pipe = tegra->drm->mode_config.num_crtc;

Instead,:

	if (dc->pipe == -1)
		dc->pipe = tegra->drm->mode_config.num_crtc;

> +static int tegra_dc_parse_dt(struct tegra_dc *dc)
> +{
> +	u32 value;
> +	int err;
> +
> +	err = of_property_read_u32(dc->dev->of_node, "nvidia,head", &value);
> +	if (err < 0)
> +		return err;
> +
> +	dc->pipe = value;

Instead:

	err = ...
	if (!err)
		dc->pipe = value;
	else
		/* Perhaps also emit an error message here */
		dc->pipe = -1;

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux