Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-gfx@lists.freedesktop.org,
	Lucas De Marchi <lucas.demarchi@intel.com>
Cc: tejas.upadhyay@intel.com, dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v1 1/4] drm/i915: Move dsm assignment to be after adjustment
Date: Thu, 15 Sep 2022 13:39:05 -0700	[thread overview]
Message-ID: <20220915-stolen-v1-1-117c5f295bb2@intel.com> (raw)
In-Reply-To: <20220915-stolen-v1-0-117c5f295bb2@intel.com>

Reduce possible side effects of assigning the region and bailing out due
to errors.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index acc561c0f0aa..42f4769bb4ac 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -418,14 +418,14 @@ static int i915_gem_init_stolen(struct intel_memory_region *mem)
 	if (resource_size(&mem->region) == 0)
 		return 0;
 
-	i915->dsm = mem->region;
-
-	if (i915_adjust_stolen(i915, &i915->dsm))
+	if (i915_adjust_stolen(i915, &mem->region))
 		return 0;
 
 	GEM_BUG_ON(i915->dsm.start == 0);
 	GEM_BUG_ON(i915->dsm.end <= i915->dsm.start);
 
+	i915->dsm = mem->region;
+
 	stolen_top = i915->dsm.end + 1;
 	reserved_base = stolen_top;
 	reserved_size = 0;

-- 
b4 0.10.0-dev-bbe61

  reply	other threads:[~2022-09-15 20:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 20:39 [Intel-gfx] [PATCH v1 0/4] drm/i915: Improvements to stolen memory setup Lucas De Marchi
2022-09-15 20:39 ` Lucas De Marchi [this message]
2022-09-16 11:57   ` [Intel-gfx] [PATCH v1 1/4] drm/i915: Move dsm assignment to be after adjustment Iddamsetty, Aravind
2022-09-15 20:39 ` [Intel-gfx] [PATCH v1 2/4] drm/i915: Add missing mask when reading GEN12_DSMBASE Lucas De Marchi
2022-09-15 21:03   ` Caz Yokoyama
2022-09-16  0:33   ` kernel test robot
2022-09-16  1:04   ` kernel test robot
2022-09-16 11:58   ` Iddamsetty, Aravind
2022-09-15 20:39 ` [Intel-gfx] [PATCH v1 3/4] drm/i915: Split i915_gem_init_stolen() Lucas De Marchi
2022-09-15 22:07   ` [Intel-gfx] [PATCH v1.1] " Lucas De Marchi
2022-09-16 12:20   ` [Intel-gfx] [PATCH v1 3/4] " Iddamsetty, Aravind
2022-09-16 16:06     ` Lucas De Marchi
2022-09-15 20:39 ` [Intel-gfx] [PATCH v1 4/4] drm/i915/dgfx: Make failure to setup stolen non-fatal Lucas De Marchi
2022-09-15 21:02 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Improvements to stolen memory setup Patchwork
2022-09-15 21:02 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-09-15 21:18 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-09-15 21:54   ` Lucas De Marchi
2022-09-15 23:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Improvements to stolen memory setup (rev2) Patchwork
2022-09-15 23:13 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-09-15 23:39 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-16  6:05 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=20220915-stolen-v1-1-117c5f295bb2@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tejas.upadhyay@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