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 <emil.velikov@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Ezequiel Garcia <ezequiel@collabora.com>
main
Emil Velikov 2020-04-15 09:57:09 +01:00 committed by Emil Velikov
parent bdb9b82cf7
commit 3b9585d88e
1 changed files with 26 additions and 26 deletions

View File

@ -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)