Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Matthew Auld <matthew.auld@intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>,
	 intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Use helper func to find out map type
Date: Fri, 16 Dec 2022 16:59:36 +0100	[thread overview]
Message-ID: <0a8bc5f2-8f6e-3d77-f385-2af25d9464e4@intel.com> (raw)
In-Reply-To: <9e24bdca-c4e0-dfa7-cd90-d6dcc29f912e@intel.com>

On 16.12.2022 16:43, Matthew Auld wrote:
> On 16/12/2022 15:27, Nirmoy Das wrote:
>> Use i915_coherent_map_type() function to find out
>> map_type of the shmem obj.
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/shmem_utils.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c 
>> b/drivers/gpu/drm/i915/gt/shmem_utils.c
>> index 402f085f3a02..e1a69803624f 100644
>> --- a/drivers/gpu/drm/i915/gt/shmem_utils.c
>> +++ b/drivers/gpu/drm/i915/gt/shmem_utils.c
>> @@ -8,6 +8,7 @@
>>   #include <linux/pagemap.h>
>>   #include <linux/shmem_fs.h>
>> +#include "i915_drv.h"
>>   #include "gem/i915_gem_object.h"
>>   #include "gem/i915_gem_lmem.h"
>>   #include "shmem_utils.h"
>> @@ -32,6 +33,8 @@ struct file *shmem_create_from_data(const char 
>> *name, void *data, size_t len)
>>   struct file *shmem_create_from_object(struct drm_i915_gem_object *obj)
>>   {
>> +    struct drm_i915_private *i915 = to_i915(obj->base.dev);
>> +    enum i915_map_type map_type;
>>       struct file *file;
>>       void *ptr;
>> @@ -41,8 +44,8 @@ struct file *shmem_create_from_object(struct 
>> drm_i915_gem_object *obj)
>>           return file;
>>       }
>> -    ptr = i915_gem_object_pin_map_unlocked(obj, 
>> i915_gem_object_is_lmem(obj) ?
>> -                        I915_MAP_WC : I915_MAP_WB);
>> +    map_type = i915_coherent_map_type(i915, obj, false);
> 
> This will now use wc on non-llc.

i915_coherent_map_type(i915, obj, true) should do the trick.

Regards
Andrzej

> 
>> +    ptr = i915_gem_object_pin_map_unlocked(obj, map_type);
>>       if (IS_ERR(ptr))
>>           return ERR_CAST(ptr);


  reply	other threads:[~2022-12-16 16:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 15:27 [Intel-gfx] [PATCH] drm/i915: Use helper func to find out map type Nirmoy Das
2022-12-16 15:43 ` Matthew Auld
2022-12-16 15:59   ` Andrzej Hajda [this message]
2022-12-16 16:33     ` Das, Nirmoy
2022-12-18 23:00 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2022-12-18 23:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-19  1:25 ` [Intel-gfx] ✓ 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=0a8bc5f2-8f6e-3d77-f385-2af25d9464e4@intel.com \
    --to=andrzej.hajda@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=nirmoy.das@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