From: Emil Velikov Date: Wed, 15 Apr 2020 08:57:09 +0000 (+0100) Subject: modetest: move pipe_resolve_connectors() further up X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fexternal-libdrm.git;a=commitdiff_plain;h=3b9585d88e0b31a1953e8f553b7ccf62851fe31f modetest: move pipe_resolve_connectors() further up Move the function above set_mode, since we'll be using it from there as of next commit. Signed-off-by: Emil Velikov Reviewed-by: Ezequiel Garcia Tested-by: Ezequiel Garcia --- diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 376f2033..b08cb789 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1403,6 +1403,32 @@ static void clear_planes(struct device *dev, struct plane_arg *p, unsigned int c } } +static int pipe_resolve_connectors(struct device *dev, struct pipe_arg *pipe) +{ + drmModeConnector *connector; + unsigned int i; + uint32_t id; + char *endp; + + for (i = 0; i < pipe->num_cons; i++) { + id = strtoul(pipe->cons[i], &endp, 10); + if (endp == pipe->cons[i]) { + connector = get_connector_by_name(dev, pipe->cons[i]); + if (!connector) { + fprintf(stderr, "no connector named '%s'\n", + pipe->cons[i]); + return -ENODEV; + } + + id = connector->connector_id; + } + + pipe->con_ids[i] = id; + } + + return 0; +} + static void set_mode(struct device *dev, struct pipe_arg *pipes, unsigned int count) { unsigned int i, j; @@ -1819,32 +1845,6 @@ static void usage(char *name) exit(0); } -static int pipe_resolve_connectors(struct device *dev, struct pipe_arg *pipe) -{ - drmModeConnector *connector; - unsigned int i; - uint32_t id; - char *endp; - - for (i = 0; i < pipe->num_cons; i++) { - id = strtoul(pipe->cons[i], &endp, 10); - if (endp == pipe->cons[i]) { - connector = get_connector_by_name(dev, pipe->cons[i]); - if (!connector) { - fprintf(stderr, "no connector named '%s'\n", - pipe->cons[i]); - return -ENODEV; - } - - id = connector->connector_id; - } - - pipe->con_ids[i] = id; - } - - return 0; -} - static char optstr[] = "acdD:efF:M:P:ps:Cvw:"; int main(int argc, char **argv)