Re: [Mesa-dev] [PATCH libdrm] modeprint: pretty print connector names

2014-01-24 Thread Lucas Stach
Ping.

Can someone please take a look and if there are no objections commit
this for me? I don't have commit access myself.

Am Freitag, den 17.01.2014, 12:19 +0100 schrieb Lucas Stach:
 Use same names as the kernel, makes it easier to identify
 connectors in the common case.
 
 Signed-off-by: Lucas Stach l.st...@pengutronix.de
 ---
  tests/modeprint/modeprint.c | 28 +++-
  1 file changed, 27 insertions(+), 1 deletion(-)
 
 diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c
 index 545ff40a98d4..6f0d03905a46 100644
 --- a/tests/modeprint/modeprint.c
 +++ b/tests/modeprint/modeprint.c
 @@ -41,6 +41,8 @@
  #include xf86drm.h
  #include xf86drmMode.h
  
 +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 +
  int connectors;
  int full_props;
  int edid;
 @@ -140,13 +142,37 @@ int printProperty(int fd, drmModeResPtr res, 
 drmModePropertyPtr props, uint64_t
   return 0;
  }
  
 +static const char * const output_names[] = { None,
 +  VGA,
 +  DVI-I,
 +  DVI-D,
 +  DVI-A,
 +  Composite,
 +  SVIDEO,
 +  LVDS,
 +  Component,
 +  DIN,
 +  DP,
 +  HDMI-A,
 +  HDMI-B,
 +  TV,
 +  eDP,
 +  Virtual,
 +  DSI,
 +};
 +
  int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, 
 uint32_t id)
  {
   int i = 0;
   struct drm_mode_modeinfo *mode = NULL;
   drmModePropertyPtr props;
  
 - printf(Connector: %d-%d\n, connector-connector_type, 
 connector-connector_type_id);
 + if (connector-connector_type  ARRAY_SIZE(output_names))
 + printf(Connector: %s-%d\n, 
 output_names[connector-connector_type],
 + connector-connector_type_id);
 + else
 + printf(Connector: %d-%d\n, connector-connector_type,
 + connector-connector_type_id);
   printf(\tid : %i\n, id);
   printf(\tencoder id : %i\n, connector-encoder_id);
   printf(\tconn   : %s\n, 
 getConnectionText(connector-connection));

-- 
Pengutronix e.K.   | Lucas Stach |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5076 |
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH libdrm] modeprint: pretty print connector names

2014-01-24 Thread Alex Deucher
On Fri, Jan 17, 2014 at 6:19 AM, Lucas Stach l.st...@pengutronix.de wrote:
 Use same names as the kernel, makes it easier to identify
 connectors in the common case.

 Signed-off-by: Lucas Stach l.st...@pengutronix.de

Reviewed-by: Alex Deucher alexander.deuc...@amd.com

If there are no other comments, I'll apply this later today.

 ---
  tests/modeprint/modeprint.c | 28 +++-
  1 file changed, 27 insertions(+), 1 deletion(-)

 diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c
 index 545ff40a98d4..6f0d03905a46 100644
 --- a/tests/modeprint/modeprint.c
 +++ b/tests/modeprint/modeprint.c
 @@ -41,6 +41,8 @@
  #include xf86drm.h
  #include xf86drmMode.h

 +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 +
  int connectors;
  int full_props;
  int edid;
 @@ -140,13 +142,37 @@ int printProperty(int fd, drmModeResPtr res, 
 drmModePropertyPtr props, uint64_t
 return 0;
  }

 +static const char * const output_names[] = { None,
 +VGA,
 +DVI-I,
 +DVI-D,
 +DVI-A,
 +Composite,
 +SVIDEO,
 +LVDS,
 +Component,
 +DIN,
 +DP,
 +HDMI-A,
 +HDMI-B,
 +TV,
 +eDP,
 +Virtual,
 +DSI,
 +};
 +
  int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, 
 uint32_t id)
  {
 int i = 0;
 struct drm_mode_modeinfo *mode = NULL;
 drmModePropertyPtr props;

 -   printf(Connector: %d-%d\n, connector-connector_type, 
 connector-connector_type_id);
 +   if (connector-connector_type  ARRAY_SIZE(output_names))
 +   printf(Connector: %s-%d\n, 
 output_names[connector-connector_type],
 +   connector-connector_type_id);
 +   else
 +   printf(Connector: %d-%d\n, connector-connector_type,
 +   connector-connector_type_id);
 printf(\tid : %i\n, id);
 printf(\tencoder id : %i\n, connector-encoder_id);
 printf(\tconn   : %s\n, 
 getConnectionText(connector-connection));
 --
 1.8.5.2

 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH libdrm] modeprint: pretty print connector names

2014-01-24 Thread Rob Clark
On Fri, Jan 17, 2014 at 6:19 AM, Lucas Stach l.st...@pengutronix.de wrote:
 Use same names as the kernel, makes it easier to identify
 connectors in the common case.

 Signed-off-by: Lucas Stach l.st...@pengutronix.de

Reviewed-by: Rob Clark robdcl...@gmail.com

 ---
  tests/modeprint/modeprint.c | 28 +++-
  1 file changed, 27 insertions(+), 1 deletion(-)

 diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c
 index 545ff40a98d4..6f0d03905a46 100644
 --- a/tests/modeprint/modeprint.c
 +++ b/tests/modeprint/modeprint.c
 @@ -41,6 +41,8 @@
  #include xf86drm.h
  #include xf86drmMode.h

 +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 +
  int connectors;
  int full_props;
  int edid;
 @@ -140,13 +142,37 @@ int printProperty(int fd, drmModeResPtr res, 
 drmModePropertyPtr props, uint64_t
 return 0;
  }

 +static const char * const output_names[] = { None,
 +VGA,
 +DVI-I,
 +DVI-D,
 +DVI-A,
 +Composite,
 +SVIDEO,
 +LVDS,
 +Component,
 +DIN,
 +DP,
 +HDMI-A,
 +HDMI-B,
 +TV,
 +eDP,
 +Virtual,
 +DSI,
 +};
 +
  int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, 
 uint32_t id)
  {
 int i = 0;
 struct drm_mode_modeinfo *mode = NULL;
 drmModePropertyPtr props;

 -   printf(Connector: %d-%d\n, connector-connector_type, 
 connector-connector_type_id);
 +   if (connector-connector_type  ARRAY_SIZE(output_names))
 +   printf(Connector: %s-%d\n, 
 output_names[connector-connector_type],
 +   connector-connector_type_id);
 +   else
 +   printf(Connector: %d-%d\n, connector-connector_type,
 +   connector-connector_type_id);
 printf(\tid : %i\n, id);
 printf(\tencoder id : %i\n, connector-encoder_id);
 printf(\tconn   : %s\n, 
 getConnectionText(connector-connection));
 --
 1.8.5.2

 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH libdrm] modeprint: pretty print connector names

2014-01-24 Thread Alex Deucher
On Fri, Jan 24, 2014 at 9:17 AM, Alex Deucher alexdeuc...@gmail.com wrote:
 On Fri, Jan 17, 2014 at 6:19 AM, Lucas Stach l.st...@pengutronix.de wrote:
 Use same names as the kernel, makes it easier to identify
 connectors in the common case.

 Signed-off-by: Lucas Stach l.st...@pengutronix.de

 Reviewed-by: Alex Deucher alexander.deuc...@amd.com

 If there are no other comments, I'll apply this later today.


Pushed.

Alex
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH libdrm] modeprint: pretty print connector names

2014-01-17 Thread Lucas Stach
Use same names as the kernel, makes it easier to identify
connectors in the common case.

Signed-off-by: Lucas Stach l.st...@pengutronix.de
---
 tests/modeprint/modeprint.c | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c
index 545ff40a98d4..6f0d03905a46 100644
--- a/tests/modeprint/modeprint.c
+++ b/tests/modeprint/modeprint.c
@@ -41,6 +41,8 @@
 #include xf86drm.h
 #include xf86drmMode.h
 
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
 int connectors;
 int full_props;
 int edid;
@@ -140,13 +142,37 @@ int printProperty(int fd, drmModeResPtr res, 
drmModePropertyPtr props, uint64_t
return 0;
 }
 
+static const char * const output_names[] = { None,
+VGA,
+DVI-I,
+DVI-D,
+DVI-A,
+Composite,
+SVIDEO,
+LVDS,
+Component,
+DIN,
+DP,
+HDMI-A,
+HDMI-B,
+TV,
+eDP,
+Virtual,
+DSI,
+};
+
 int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, 
uint32_t id)
 {
int i = 0;
struct drm_mode_modeinfo *mode = NULL;
drmModePropertyPtr props;
 
-   printf(Connector: %d-%d\n, connector-connector_type, 
connector-connector_type_id);
+   if (connector-connector_type  ARRAY_SIZE(output_names))
+   printf(Connector: %s-%d\n, 
output_names[connector-connector_type],
+   connector-connector_type_id);
+   else
+   printf(Connector: %d-%d\n, connector-connector_type,
+   connector-connector_type_id);
printf(\tid : %i\n, id);
printf(\tencoder id : %i\n, connector-encoder_id);
printf(\tconn   : %s\n, 
getConnectionText(connector-connection));
-- 
1.8.5.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev