[Intel-gfx] [PATCH 4/6] KMS: Map frame buffer at alloc time when running without UXA
Ian Romanick
idr at freedesktop.org
Fri Jul 10 21:35:37 CEST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Keith Packard wrote:
> Under KMS, the whole frame buffer is never allocated to the X server, and so
> accessing the frame buffer must be done by directly mapping it using
> drm_intel_gem_bo_map_gtt when it is created.
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
> src/drmmode_display.c | 16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index e9296dc..6681e7e 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -1021,6 +1021,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
> ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
> uint32_t old_fb_id;
> int i, pitch, old_width, old_height, old_pitch;
> + pointer *data;
Is 'pointer *' actually what you wanted here? Either 'pointer' or plain
old 'void *' should be fine.
>
> if (scrn->virtualX == width && scrn->virtualY == height)
> return TRUE;
> @@ -1052,10 +1053,21 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
> goto fail;
>
> i830_set_pixmap_bo(screen->GetScreenPixmap(screen), pI830->front_buffer->bo);
> - scrn->fbOffset = pI830->front_buffer->offset;
> + if (pI830->accel == ACCEL_UXA)
> + data = NULL;
> + else {
> + drm_intel_gem_bo_map_gtt(pI830->front_buffer->bo);
> + data = pI830->front_buffer->bo->virtual;
> + }
>
> screen->ModifyPixmapHeader(screen->GetScreenPixmap(screen),
> - width, height, -1, -1, pitch * pI830->cpp, NULL);
> + width, height, -1, -1, pitch * pI830->cpp,
> + data);
> +
> + /* ick. xf86EnableDisableFBAccess smashes the screen pixmap devPrivate,
> + * so update the value it uses
> + */
> + scrn->pixmapPrivate.ptr = data;
> xf86DrvMsg(scrn->scrnIndex, X_INFO, "New front buffer at 0x%lx\n",
> pI830->front_buffer->offset);
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpXmAgACgkQX1gOwKyEAw9j0ACglW0VmnJ725qmXObfbv3P6+jk
yXAAn24JH0BmJa54bSVBSPjyHuzlp/8V
=NHaM
-----END PGP SIGNATURE-----
More information about the Intel-gfx
mailing list