All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, apoorva1.singh@intel.com,
	zbigniew.kempczynski@intel.com,
	Ramalingam C <ramalingam.c@intel.com>,
	Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 3/3] lib/igt_fb: Support fbs backed by local memory
Date: Thu, 19 Aug 2021 19:44:48 +0300	[thread overview]
Message-ID: <YR6KgNnLEAxgx7Al@intel.com> (raw)
In-Reply-To: <20210819115942.23920-4-thomas.hellstrom@linux.intel.com>

On Thu, Aug 19, 2021 at 01:59:42PM +0200, Thomas Hellström wrote:
> From: Ramalingam C <ramalingam.c@intel.com>
> 
> When local memory is supported, buffer object, backing the framebuffer
> should be allocated from local memory.
> 
> Dumb buffer allocation takes care of this requirement from kernel
> itself. So when we allocate BO through gem_create we make sure that
> BO is from local memory.
> 
> Cc: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
>  lib/igt_fb.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 2e53d922..618842df 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -49,6 +49,7 @@
>  #include "intel_batchbuffer.h"
>  #include "intel_chipset.h"
>  #include "intel_bufops.h"
> +#include "i915/intel_memory_region.h"
>  
>  /**
>   * SECTION:igt_fb
> @@ -1102,9 +1103,10 @@ static int create_bo_for_fb(struct igt_fb *fb, bool prefer_sysmem)
>  		fb->is_dumb = false;
>  
>  		if (is_i915_device(fd)) {
> +			uint32_t region = gem_has_lmem(fd) ? REGION_LMEM(0) : REGION_SMEM;
>  			int err;
>  
> -			fb->gem_handle = gem_create(fd, fb->size);
> +			fb->gem_handle = gem_create_in_memory_regions(fd, fb->size, region);

Shouldn't we just have a gem_create_dtrt() for these sorts of things?

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  			err = __gem_set_tiling(fd, fb->gem_handle,
>  					       igt_fb_mod_to_tiling(fb->modifier),
>  					       fb->strides[0]);
> -- 
> 2.31.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2021-08-19 16:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 11:59 [igt-dev] [PATCH i-g-t 0/3] Fixes for some kms-related DG1 tests Thomas Hellström
2021-08-19 11:59 ` [igt-dev] [PATCH i-g-t 1/3] lib/ioctl_wrappers: Query if device supports set/get legacy tiling Thomas Hellström
2021-08-19 16:26   ` Ville Syrjälä
2021-08-19 11:59 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_addfb_basic: Skip tiling subtests on device without hw tiling Thomas Hellström
2021-08-19 16:42   ` Ville Syrjälä
2021-08-19 11:59 ` [igt-dev] [PATCH i-g-t 3/3] lib/igt_fb: Support fbs backed by local memory Thomas Hellström
2021-08-19 16:44   ` Ville Syrjälä [this message]
2021-08-19 12:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Fixes for some kms-related DG1 tests Patchwork
2021-08-19 14:28 ` [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=YR6KgNnLEAxgx7Al@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=apoorva1.singh@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=dominik.grzegorzek@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=ramalingam.c@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.