AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lepton Wu <ytht.net@gmail.com>
To: amd-gfx@lists.freedesktop.org
Cc: marek.olsak@amd.com, Lepton Wu <ytht.net@gmail.com>,
	christian.koenig@amd.com, bas@basnieuwenhuizen.nl
Subject: [PATCH] drm/amdgpu: Always align dumb buffer at PAGE_SIZE
Date: Thu, 22 Sep 2022 16:04:52 -0700	[thread overview]
Message-ID: <20220922230452.3903316-1-ytht.net@gmail.com> (raw)

Since size has been aligned to PAGE_SIZE already, just align it
to PAGE_SIZE so later the buffer can be used as a texture in mesa
after https://cgit.freedesktop.org/mesa/mesa/commit/?id=f7a4051b8
Otherwise, si_texture_create_object will fail at line
"buf->alignment < tex->surface.alignment"

Signed-off-by: Lepton Wu <ytht.net@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 8ef31d687ef3b..8dca0c920d3ce 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -928,7 +928,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
 	args->size = ALIGN(args->size, PAGE_SIZE);
 	domain = amdgpu_bo_get_preferred_domain(adev,
 				amdgpu_display_supported_domains(adev, flags));
-	r = amdgpu_gem_object_create(adev, args->size, 0, domain, flags,
+	r = amdgpu_gem_object_create(adev, args->size, PAGE_SIZE, domain, flags,
 				     ttm_bo_type_device, NULL, &gobj);
 	if (r)
 		return -ENOMEM;
-- 
2.37.3.998.g577e59143f-goog


             reply	other threads:[~2022-09-23 13:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 23:04 Lepton Wu [this message]
2022-09-23  5:14 ` [PATCH] drm/amdgpu: Always align dumb buffer at PAGE_SIZE Christian König
2022-09-23  5:28   ` lepton
2022-09-23  5:30     ` Christian König
2022-09-23  6:23       ` Marek Olšák
2022-09-26  9:21         ` Christian König

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=20220922230452.3903316-1-ytht.net@gmail.com \
    --to=ytht.net@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bas@basnieuwenhuizen.nl \
    --cc=christian.koenig@amd.com \
    --cc=marek.olsak@amd.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