From: "Das, Nirmoy" <nirmoy.das@linux.intel.com>
To: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
igt-dev@lists.freedesktop.org, zbigniew.kempczynski@intel.com,
mchehab@kernel.org, jani.nikula@intel.com
Subject: Re: [igt-dev] [i-g-t 1/5] lib/xe/xe_ioctl: Add a helper to map the buffer
Date: Mon, 20 Mar 2023 15:28:40 +0100 [thread overview]
Message-ID: <94ddeeea-2d01-56a3-e983-8046fe7da1d6@linux.intel.com> (raw)
In-Reply-To: <20230320100017.2913328-2-bhanuprakash.modem@intel.com>
On 3/20/2023 11:00 AM, Bhanuprakash Modem wrote:
> Create a new helper to map the buffer with the user PROT flags.
>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Looks good to me. The series is Acked-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> lib/xe/xe_ioctl.c | 14 ++++++++++++--
> lib/xe/xe_ioctl.h | 1 +
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
> index 9d5793dff..66a8393fe 100644
> --- a/lib/xe/xe_ioctl.c
> +++ b/lib/xe/xe_ioctl.c
> @@ -334,18 +334,28 @@ uint64_t xe_bo_mmap_offset(int fd, uint32_t bo)
> return mmo.offset;
> }
>
> -void *xe_bo_map(int fd, uint32_t bo, size_t size)
> +static void *__xe_bo_map(int fd, uint16_t bo, size_t size, int prot)
> {
> uint64_t mmo;
> void *map;
>
> mmo = xe_bo_mmap_offset(fd, bo);
> - map = mmap(NULL, size, PROT_WRITE, MAP_SHARED, fd, mmo);
> + map = mmap(NULL, size, prot, MAP_SHARED, fd, mmo);
> igt_assert(map != MAP_FAILED);
>
> return map;
> }
>
> +void *xe_bo_map(int fd, uint32_t bo, size_t size)
> +{
> + return __xe_bo_map(fd, bo, size, PROT_WRITE);
> +}
> +
> +void *xe_bo_mmap_ext(int fd, uint32_t bo, size_t size, int prot)
> +{
> + return __xe_bo_map(fd, bo, size, prot);
> +}
> +
> static int __xe_exec(int fd, struct drm_xe_exec *exec)
> {
> int err = 0;
> diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
> index 5c7e773fa..d8c40eda0 100644
> --- a/lib/xe/xe_ioctl.h
> +++ b/lib/xe/xe_ioctl.h
> @@ -73,6 +73,7 @@ uint32_t xe_engine_create_class(int fd, uint32_t vm, uint16_t class);
> void xe_engine_destroy(int fd, uint32_t engine);
> uint64_t xe_bo_mmap_offset(int fd, uint32_t bo);
> void *xe_bo_map(int fd, uint32_t bo, size_t size);
> +void *xe_bo_mmap_ext(int fd, uint32_t bo, size_t size, int prot);
> void xe_exec(int fd, struct drm_xe_exec *exec);
> void xe_exec_sync(int fd, uint32_t engine, uint64_t addr,
> struct drm_xe_sync *sync, uint32_t num_syncs);
next prev parent reply other threads:[~2023-03-20 14:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 10:00 [igt-dev] [i-g-t 0/5] Enable ADDFB tests for XE Bhanuprakash Modem
2023-03-20 10:00 ` [igt-dev] [i-g-t 1/5] lib/xe/xe_ioctl: Add a helper to map the buffer Bhanuprakash Modem
2023-03-20 14:28 ` Das, Nirmoy [this message]
2023-03-23 18:57 ` Zbigniew Kempczyński
2023-03-20 10:00 ` [igt-dev] [i-g-t 2/5] lib/igt_fb: Add support for allocating buffers for XE Bhanuprakash Modem
2023-03-23 19:01 ` Zbigniew Kempczyński
2023-03-20 10:00 ` [igt-dev] [i-g-t 3/5] tests/kms_addfb_basic: Add XE support Bhanuprakash Modem
2023-03-22 8:49 ` Kamil Konieczny
2023-03-23 19:04 ` Zbigniew Kempczyński
2023-03-31 13:51 ` Modem, Bhanuprakash
2023-03-20 10:00 ` [igt-dev] [i-g-t 4/5] tests/kms_force_connector_basic: " Bhanuprakash Modem
2023-03-23 19:06 ` Zbigniew Kempczyński
2023-03-31 13:53 ` Modem, Bhanuprakash
2023-03-20 10:00 ` [igt-dev] [i-g-t 5/5] xe-fast-feedback: Add basic kms tests to XE BAT Bhanuprakash Modem
2023-03-20 13:43 ` [igt-dev] ✗ Fi.CI.BAT: failure for Enable ADDFB tests for XE Patchwork
2023-03-20 14:40 ` [igt-dev] ✓ Fi.CI.BAT: success for Enable ADDFB tests for XE (rev2) Patchwork
2023-03-20 17:29 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=94ddeeea-2d01-56a3-e983-8046fe7da1d6@linux.intel.com \
--to=nirmoy.das@linux.intel.com \
--cc=bhanuprakash.modem@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=mchehab@kernel.org \
--cc=zbigniew.kempczynski@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