[xf86-video-armada][PATCH] common: fix up output naming convention
Russell King
rmk at armlinux.org.uk
Thu Sep 6 09:29:34 UTC 2018
Hi Stefan,
On Wed, Sep 05, 2018 at 05:44:49PM -0700, Stefan Agner wrote:
> Currently some output type names are missing. Also different naming
> connventions are used than in the kernel and in other drivers such as
> the modesetting driver (e.g. missing dash between connector type and
> connector type id).
>
> Follow modesetting and use the same output names introduced in the
> in the xserver git repo with commit 139e36dd5cba ("modesetting:
> fix up output naming convention")
>
> This will break backwards compatibility with existing xorg.conf's that
> reference output names, but the alternative is to create a separate
> counting system, further disconnecting from the kernel names.
The convention that xf86-video-armada follows is from the i915 driver
rather than modesetting or the kernel.
I know users of this driver have an xorg.conf with a section to
configure (eg) display rotation or preferred mode, so this change will
cause a user visible regression.
Also, you seem to be introducing a different coding style - nowhere in
the file you are modifying are four spaces used for indentation - it is
all tabs. Also note the preference for named initialisers.
Thanks.
>
> Signed-off-by: Stefan Agner <stefan at agner.ch>
> ---
> src/common_drm_conn.c | 34 +++++++++++++++++++---------------
> 1 file changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/src/common_drm_conn.c b/src/common_drm_conn.c
> index 9f73d20..77ed96b 100644
> --- a/src/common_drm_conn.c
> +++ b/src/common_drm_conn.c
> @@ -372,21 +372,25 @@ static const xf86OutputFuncsRec drm_output_funcs = {
> .destroy = common_drm_conn_destroy,
> };
>
> -/* Convert libdrm's connector type to Xorg name */
> static const char *const output_names[] = {
> - [DRM_MODE_CONNECTOR_Unknown] = "None",
> - [DRM_MODE_CONNECTOR_VGA] = "VGA",
> - [DRM_MODE_CONNECTOR_DVII] = "DVI",
> - [DRM_MODE_CONNECTOR_DVID] = "DVI",
> - [DRM_MODE_CONNECTOR_DVIA] = "DVI",
> - [DRM_MODE_CONNECTOR_Composite] = "Composite",
> - [DRM_MODE_CONNECTOR_SVIDEO] = "TV",
> - [DRM_MODE_CONNECTOR_LVDS] = "LVDS",
> - [DRM_MODE_CONNECTOR_Component] = "CTV",
> - [DRM_MODE_CONNECTOR_9PinDIN] = "DIN",
> - [DRM_MODE_CONNECTOR_DisplayPort] = "DP",
> - [DRM_MODE_CONNECTOR_HDMIA] = "HDMI",
> - [DRM_MODE_CONNECTOR_HDMIB] = "HDMI",
> + "None",
> + "VGA",
> + "DVI-I",
> + "DVI-D",
> + "DVI-A",
> + "Composite",
> + "SVIDEO",
> + "LVDS",
> + "Component",
> + "DIN",
> + "DP",
> + "HDMI",
> + "HDMI-B",
> + "TV",
> + "eDP",
> + "Virtual",
> + "DSI",
> + "DPI",
> };
>
> static const char *common_drm_output_name(uint32_t type)
> @@ -436,7 +440,7 @@ void common_drm_conn_init(ScrnInfoPtr pScrn, uint32_t id)
> return;
> }
>
> - snprintf(name, sizeof(name), "%s%d",
> + snprintf(name, sizeof(name), "%s-%d",
> common_drm_output_name(koutput->connector_type),
> koutput->connector_type_id);
>
> --
> 2.18.0
>
--
Russell King
More information about the etnaviv
mailing list