From: Daniel Vetter <daniel@ffwll.ch>
To: Nirmoy Das <nirmoy.aiemd@gmail.com>
Cc: David1.Zhou@amd.com, thellstrom@vmware.com,
amd-gfx@lists.freedesktop.org, airlied@linux.ie,
kenny.ho@amd.com, brian.welty@intel.com,
maarten.lankhorst@linux.intel.com,
dri-devel@lists.freedesktop.org, nirmoy.das@amd.com,
linux-graphics-maintainer@vmware.com, kraxel@redhat.com,
daniel@ffwll.ch, alexander.deucher@amd.com, sean@poorly.run,
christian.koenig@amd.com, bskeggs@redhat.com
Subject: Re: [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2
Date: Thu, 20 Feb 2020 19:11:23 +0100 [thread overview]
Message-ID: <20200220181123.GU2363188@phenom.ffwll.local> (raw)
In-Reply-To: <20200219135322.56463-8-nirmoy.das@amd.com>
On Wed, Feb 19, 2020 at 02:53:21PM +0100, Nirmoy Das wrote:
> Switch over to GEM VRAM's implementation to retrieve bo->offset
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
> drivers/gpu/drm/bochs/bochs_kms.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
> index 8066d7d370d5..18d2ec34534d 100644
> --- a/drivers/gpu/drm/bochs/bochs_kms.c
> +++ b/drivers/gpu/drm/bochs/bochs_kms.c
> @@ -29,16 +29,21 @@ static void bochs_plane_update(struct bochs_device *bochs,
> struct drm_plane_state *state)
> {
> struct drm_gem_vram_object *gbo;
> + s64 gpu_addr;
>
> if (!state->fb || !bochs->stride)
> return;
>
> gbo = drm_gem_vram_of_gem(state->fb->obj[0]);
> + gpu_addr = drm_gem_vram_offset(gbo);
> + if (WARN_ON_ONCE(gpu_addr < 0))
> + return; /* Bug: we didn't pin the BO to VRAM in prepare_fb. */
That negative errno in gpu_addr from vram helpers is kinda wild.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> +
> bochs_hw_setbase(bochs,
> state->crtc_x,
> state->crtc_y,
> state->fb->pitches[0],
> - state->fb->offsets[0] + gbo->bo.offset);
> + state->fb->offsets[0] + gpu_addr);
> bochs_hw_setformat(bochs, state->fb->format);
> }
>
> --
> 2.25.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: Nirmoy Das <nirmoy.aiemd@gmail.com>
Cc: thellstrom@vmware.com, amd-gfx@lists.freedesktop.org,
airlied@linux.ie, kenny.ho@amd.com, brian.welty@intel.com,
dri-devel@lists.freedesktop.org, nirmoy.das@amd.com,
linux-graphics-maintainer@vmware.com, kraxel@redhat.com,
alexander.deucher@amd.com, sean@poorly.run,
christian.koenig@amd.com, bskeggs@redhat.com
Subject: Re: [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2
Date: Thu, 20 Feb 2020 19:11:23 +0100 [thread overview]
Message-ID: <20200220181123.GU2363188@phenom.ffwll.local> (raw)
In-Reply-To: <20200219135322.56463-8-nirmoy.das@amd.com>
On Wed, Feb 19, 2020 at 02:53:21PM +0100, Nirmoy Das wrote:
> Switch over to GEM VRAM's implementation to retrieve bo->offset
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
> drivers/gpu/drm/bochs/bochs_kms.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
> index 8066d7d370d5..18d2ec34534d 100644
> --- a/drivers/gpu/drm/bochs/bochs_kms.c
> +++ b/drivers/gpu/drm/bochs/bochs_kms.c
> @@ -29,16 +29,21 @@ static void bochs_plane_update(struct bochs_device *bochs,
> struct drm_plane_state *state)
> {
> struct drm_gem_vram_object *gbo;
> + s64 gpu_addr;
>
> if (!state->fb || !bochs->stride)
> return;
>
> gbo = drm_gem_vram_of_gem(state->fb->obj[0]);
> + gpu_addr = drm_gem_vram_offset(gbo);
> + if (WARN_ON_ONCE(gpu_addr < 0))
> + return; /* Bug: we didn't pin the BO to VRAM in prepare_fb. */
That negative errno in gpu_addr from vram helpers is kinda wild.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> +
> bochs_hw_setbase(bochs,
> state->crtc_x,
> state->crtc_y,
> state->fb->pitches[0],
> - state->fb->offsets[0] + gbo->bo.offset);
> + state->fb->offsets[0] + gpu_addr);
> bochs_hw_setformat(bochs, state->fb->format);
> }
>
> --
> 2.25.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-02-20 18:11 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 13:53 [PATCH v3 0/8] do not store GPU address in TTM Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-19 13:53 ` [PATCH 1/8] drm/amdgpu: move ttm bo->offset to amdgpu_bo Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-21 1:14 ` Luben Tuikov
2020-02-21 1:14 ` Luben Tuikov
2020-02-19 13:53 ` [PATCH 2/8] drm/radeon: don't use ttm bo->offset Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-21 1:19 ` Luben Tuikov
2020-02-21 1:19 ` Luben Tuikov
2020-02-21 13:27 ` Nirmoy
2020-02-19 13:53 ` [PATCH 3/8] drm/vmwgfx: " Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-21 8:45 ` Thomas Hellström (VMware)
2020-02-21 8:45 ` Thomas Hellström (VMware)
2020-02-19 13:53 ` [PATCH 4/8] drm/nouveau: don't use ttm bo->offset v3 Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-21 1:22 ` Luben Tuikov
2020-02-21 1:22 ` Luben Tuikov
2020-02-19 13:53 ` [PATCH 5/8] drm/qxl: don't use ttm bo->offset Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-19 13:53 ` [PATCH 6/8] drm/vram-helper: don't use ttm bo->offset v2 Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-20 18:09 ` Daniel Vetter
2020-02-20 18:09 ` Daniel Vetter
2020-02-20 18:29 ` Nirmoy
2020-02-20 18:29 ` Nirmoy
2020-02-21 11:02 ` Thomas Zimmermann
2020-02-21 11:02 ` Thomas Zimmermann
2020-02-19 13:53 ` [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2 Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-20 18:11 ` Daniel Vetter [this message]
2020-02-20 18:11 ` Daniel Vetter
2020-02-19 13:53 ` [PATCH 8/8] drm/ttm: do not keep GPU dependent addresses Nirmoy Das
2020-02-19 13:53 ` Nirmoy Das
2020-02-21 8:48 ` [PATCH v3 0/8] do not store GPU address in TTM Thomas Hellström (VMware)
2020-02-21 8:48 ` Thomas Hellström (VMware)
2020-02-21 11:32 ` Nirmoy
-- strict thread matches above, loose matches on Subject: below --
2020-03-05 13:29 [PATCH v4 " Nirmoy Das
2020-03-05 13:29 ` [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2 Nirmoy Das
2020-03-05 13:29 ` Nirmoy Das
2020-04-01 18:42 [PATCH v5 0/8] do not store GPU address in TTM Nirmoy Das
2020-04-01 18:42 ` [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2 Nirmoy Das
2020-06-24 18:26 [RESEND] [PATCH v6 0/8] do not store GPU address in TTM Nirmoy Das
2020-06-24 18:26 ` [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2 Nirmoy Das
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=20200220181123.GU2363188@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=David1.Zhou@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=brian.welty@intel.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kenny.ho@amd.com \
--cc=kraxel@redhat.com \
--cc=linux-graphics-maintainer@vmware.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=nirmoy.aiemd@gmail.com \
--cc=nirmoy.das@amd.com \
--cc=sean@poorly.run \
--cc=thellstrom@vmware.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.