Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Mohammed Thasleem <mohammed.thasleem@intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v2] tests/kms_lease: Cache xe_device info for lease fd
Date: Tue, 26 Dec 2023 14:17:20 +0530	[thread overview]
Message-ID: <f7962bc5-e5cf-490e-bc01-7064816b2b3b@intel.com> (raw)
In-Reply-To: <20231226080930.32272-1-mohammed.thasleem@intel.com>


On 12/26/2023 1:39 PM, Mohammed Thasleem wrote:
> In case of xe device for lessor fd, the xe_device struct gets
> created and cached during drm_open. But for the lessee fd,
> the xe_device info struct is not created and cached.
>
> This causes problem in prepare_crtc() for lessee with xe, which
> needs the xe_device info struct. So, create and cache the xe_device
> struct info for lease fd, when we make lease and remove it from
> cache while terminating the lease.
>
> v2: -Update description and move logic to make_lease call. (Ankit)
>      -Add xe_device_put, while terminating the lease. (Ankit)
>
> Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>

LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


Regards,

Ankit

> ---
>   tests/kms_lease.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/tests/kms_lease.c b/tests/kms_lease.c
> index 8ac58af38..f7531c803 100644
> --- a/tests/kms_lease.c
> +++ b/tests/kms_lease.c
> @@ -48,6 +48,8 @@
>   
>   #include <drm.h>
>   #include "igt_device.h"
> +#include "xe_drm.h"
> +#include "xe/xe_query.h"
>   
>   /**
>    * SUBTEST: atomic-implicit-crtc
> @@ -267,12 +269,20 @@ static int make_lease(data_t *data)
>   	if (ret)
>   		return ret;
>   
> +	/* Cache xe_device struct */
> +	if (is_xe_device(data->lease.fd))
> +		xe_device_get(data->lease.fd);
> +
>   	data->lease.lessee_id = mcl.lessee_id;
>   	return 0;
>   }
>   
>   static void terminate_lease(int lease_fd)
>   {
> +	/* Remove xe_device from cache. */
> +	if (is_xe_device(lease_fd))
> +		xe_device_put(lease_fd);
> +
>   	close(lease_fd);
>   }
>   

WARNING: multiple messages have this Message-ID (diff)
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Mohammed Thasleem <mohammed.thasleem@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2] tests/kms_lease: Cache xe_device info for lease fd
Date: Tue, 26 Dec 2023 14:17:20 +0530	[thread overview]
Message-ID: <f7962bc5-e5cf-490e-bc01-7064816b2b3b@intel.com> (raw)
Message-ID: <20231226084720.wvIBRlBavM3l1nXd0TaqaDQXQIePUP9aRS80mxrCciM@z> (raw)
In-Reply-To: <20231226080930.32272-1-mohammed.thasleem@intel.com>


On 12/26/2023 1:39 PM, Mohammed Thasleem wrote:
> In case of xe device for lessor fd, the xe_device struct gets
> created and cached during drm_open. But for the lessee fd,
> the xe_device info struct is not created and cached.
>
> This causes problem in prepare_crtc() for lessee with xe, which
> needs the xe_device info struct. So, create and cache the xe_device
> struct info for lease fd, when we make lease and remove it from
> cache while terminating the lease.
>
> v2: -Update description and move logic to make_lease call. (Ankit)
>      -Add xe_device_put, while terminating the lease. (Ankit)
>
> Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>

LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


Regards,

Ankit

> ---
>   tests/kms_lease.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/tests/kms_lease.c b/tests/kms_lease.c
> index 8ac58af38..f7531c803 100644
> --- a/tests/kms_lease.c
> +++ b/tests/kms_lease.c
> @@ -48,6 +48,8 @@
>   
>   #include <drm.h>
>   #include "igt_device.h"
> +#include "xe_drm.h"
> +#include "xe/xe_query.h"
>   
>   /**
>    * SUBTEST: atomic-implicit-crtc
> @@ -267,12 +269,20 @@ static int make_lease(data_t *data)
>   	if (ret)
>   		return ret;
>   
> +	/* Cache xe_device struct */
> +	if (is_xe_device(data->lease.fd))
> +		xe_device_get(data->lease.fd);
> +
>   	data->lease.lessee_id = mcl.lessee_id;
>   	return 0;
>   }
>   
>   static void terminate_lease(int lease_fd)
>   {
> +	/* Remove xe_device from cache. */
> +	if (is_xe_device(lease_fd))
> +		xe_device_put(lease_fd);
> +
>   	close(lease_fd);
>   }
>   

  reply	other threads:[~2023-12-26  8:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 10:07 [PATCH i-g-t] tests/kms_lease: Cache xe_device info for lease fd Mohammed Thasleem
2023-12-12 11:49 ` ✗ Fi.CI.BAT: failure for " Patchwork
2023-12-12 12:16 ` ✓ CI.xeBAT: success " Patchwork
2023-12-13  5:50 ` [PATCH i-g-t] " Nautiyal, Ankit K
2023-12-22  7:04   ` Nautiyal, Ankit K
2023-12-22  7:04     ` Nautiyal, Ankit K
2023-12-22 13:07 ` [PATCH i-g-t v2] " Mohammed Thasleem
2023-12-26  8:09 ` Mohammed Thasleem
2023-12-26  8:47   ` Nautiyal, Ankit K [this message]
2023-12-26  8:47     ` Nautiyal, Ankit K

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=f7962bc5-e5cf-490e-bc01-7064816b2b3b@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=mohammed.thasleem@intel.com \
    /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