public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Subject: Re: [igt-dev] [PATCH i-g-t] lib/chamelium: Check drmModeGetResources()
Date: Mon, 15 Oct 2018 21:40:19 +0000	[thread overview]
Message-ID: <7445650fc8cc7474cfee4bd657ec59da483d8403.camel@intel.com> (raw)
In-Reply-To: <20181005080802.11082-1-chris@chris-wilson.co.uk>

On Fri, 2018-10-05 at 09:08 +0100, Chris Wilson wrote:
> If KMS is not available, drmModeGetResoures() reports NULL and so we
> cannot use this device to find the chamelium connector.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/igt_chamelium.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
> index fe5c4dac..3150f609 100644
> --- a/lib/igt_chamelium.c
> +++ b/lib/igt_chamelium.c
> @@ -1422,6 +1422,10 @@ static bool
> chamelium_read_port_mappings(struct chamelium *chamelium,
>  	int port_i, i, j;
>  	bool ret = true;
>  
> +	res = drmModeGetResources(drm_fd);
> +	if (!res)
> +		return false;
> +
>  	group_list = g_key_file_get_groups(igt_key_file, NULL);
>  
>  	/* Count how many connector mappings are specified in the
> config */
> @@ -1433,7 +1437,6 @@ static bool chamelium_read_port_mappings(struct
> chamelium *chamelium,
>  	chamelium->ports = calloc(sizeof(struct chamelium_port),
>  				  chamelium->port_count);
>  	port_i = 0;
> -	res = drmModeGetResources(drm_fd);
>  
>  	for (i = 0; group_list[i] != NULL; i++) {
>  		group = group_list[i];
> @@ -1494,8 +1497,8 @@ static bool chamelium_read_port_mappings(struct
> chamelium *chamelium,
>  	}
>  
>  out:
> -	drmModeFreeResources(res);
>  	g_strfreev(group_list);
> +	drmModeFreeResources(res);
>  
>  	return ret;
>  }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2018-10-15 21:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05  8:08 [igt-dev] [PATCH i-g-t] lib/chamelium: Check drmModeGetResources() Chris Wilson
2018-10-05 12:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-10-05 17:18 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-10-15 21:40 ` Souza, Jose [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7445650fc8cc7474cfee4bd657ec59da483d8403.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox