dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jakob Bornecrantz <jakob@vmware.com>
To: Dave Airlie <airlied@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] vmwgfx: add dumb ioctl support
Date: Tue, 28 Aug 2012 08:06:03 -0700 (PDT)	[thread overview]
Message-ID: <2023004030.27251645.1346166363081.JavaMail.root@vmware.com> (raw)
In-Reply-To: <1346118834-17339-1-git-send-email-airlied@gmail.com>

Thanks for doing this.

With an exception of a comment below all 3 patches are
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>


----- Original Message -----
> From: Dave Airlie <airlied@redhat.com>
> 
> Testing and works with the -modesetting driver at least so far.
> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c      |  5 +++
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h      | 10 +++++
>  drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 73
>  ++++++++++++++++++++++++++++++++
>  3 files changed, 88 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index 4d9edea..4d13bf7 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -1154,6 +1154,11 @@ static struct drm_driver driver = {
>  	.open = vmw_driver_open,
>  	.preclose = vmw_preclose,
>  	.postclose = vmw_postclose,
> +
> +	.dumb_create = vmw_dumb_create,
> +	.dumb_map_offset = vmw_dumb_map_offset,
> +	.dumb_destroy = vmw_dumb_destroy,
> +
>  	.fops = &vmwgfx_driver_fops,
>  	.name = VMWGFX_DRIVER_NAME,
>  	.desc = VMWGFX_DRIVER_DESC,
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> index d0f2c07..29c984f 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> @@ -645,6 +645,16 @@ int vmw_kms_readback(struct vmw_private
> *dev_priv,
>  int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
>  				struct drm_file *file_priv);
>  
> +int vmw_dumb_create(struct drm_file *file_priv,
> +		    struct drm_device *dev,
> +		    struct drm_mode_create_dumb *args);
> +
> +int vmw_dumb_map_offset(struct drm_file *file_priv,
> +			struct drm_device *dev, uint32_t handle,
> +			uint64_t *offset);
> +int vmw_dumb_destroy(struct drm_file *file_priv,
> +		     struct drm_device *dev,
> +		     uint32_t handle);
>  /**
>   * Overlay control - vmwgfx_overlay.c
>   */
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
> index 22bf9a2..5761775 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
> @@ -1917,3 +1917,76 @@ err_ref:
>  	vmw_resource_unreference(&res);
>  	return ret;
>  }
> +
> +
> +int vmw_dumb_create(struct drm_file *file_priv,
> +		    struct drm_device *dev,
> +		    struct drm_mode_create_dumb *args)
> +{
> +	struct vmw_private *dev_priv = vmw_priv(dev);
> +	struct vmw_master *vmaster = vmw_master(file_priv->master);
> +	struct vmw_user_dma_buffer *vmw_user_bo;
> +	struct ttm_buffer_object *tmp;
> +	int ret;
> +
> +	args->pitch = args->width * args->bpp / 8;
> +	args->size = args->pitch * args->height;

We talked about this on IRC, it should probably be
(args->bpp + 7) / 8


Cheers, Jakob.

      reply	other threads:[~2012-08-28 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28  1:53 [PATCH] vmwgfx: add dumb ioctl support Dave Airlie
2012-08-28 15:06 ` Jakob Bornecrantz [this message]

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=2023004030.27251645.1346166363081.JavaMail.root@vmware.com \
    --to=jakob@vmware.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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