* [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers @ 2011-10-22 8:29 Thomas Hellstrom 2011-10-22 8:29 ` [PATCH 2/2] vmwgfx: Don't pass unused arguments to do_dirty functions Thomas Hellstrom 2011-10-24 21:25 ` [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Konrad Rzeszutek Wilk 0 siblings, 2 replies; 5+ messages in thread From: Thomas Hellstrom @ 2011-10-22 8:29 UTC (permalink / raw) To: airlied; +Cc: Thomas Hellstrom, dri-devel From: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 39b99db..00ec619 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -679,6 +679,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer) { + int depth = framebuffer->base.depth; size_t fifo_size; int ret; @@ -687,6 +688,13 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, SVGAFifoCmdDefineGMRFB body; } *cmd; + /* Emulate RGBA support, contrary to svga_reg.h this is not + * supported by hosts. This is only a problem if we are reading + * this value later and expecting what we uploaded back. + */ + if (depth == 32) + depth = 24; + fifo_size = sizeof(*cmd); cmd = kmalloc(fifo_size, GFP_KERNEL); if (unlikely(cmd == NULL)) { @@ -697,7 +705,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, memset(cmd, 0, fifo_size); cmd->header = SVGA_CMD_DEFINE_GMRFB; cmd->body.format.bitsPerPixel = framebuffer->base.bits_per_pixel; - cmd->body.format.colorDepth = framebuffer->base.depth; + cmd->body.format.colorDepth = depth; cmd->body.format.reserved = 0; cmd->body.bytesPerLine = framebuffer->base.pitch; cmd->body.ptr.gmrId = framebuffer->user_handle; -- 1.7.4.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] vmwgfx: Don't pass unused arguments to do_dirty functions 2011-10-22 8:29 [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Thomas Hellstrom @ 2011-10-22 8:29 ` Thomas Hellstrom 2011-10-24 21:25 ` [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Konrad Rzeszutek Wilk 1 sibling, 0 replies; 5+ messages in thread From: Thomas Hellstrom @ 2011-10-22 8:29 UTC (permalink / raw) To: airlied; +Cc: Thomas Hellstrom, dri-devel From: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 00ec619..8b14dfd 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -353,7 +353,6 @@ void vmw_framebuffer_surface_destroy(struct drm_framebuffer *framebuffer) static int do_surface_dirty_sou(struct vmw_private *dev_priv, struct drm_file *file_priv, struct vmw_framebuffer *framebuffer, - struct vmw_surface *surf, unsigned flags, unsigned color, struct drm_clip_rect *clips, unsigned num_clips, int inc) @@ -381,7 +380,6 @@ static int do_surface_dirty_sou(struct vmw_private *dev_priv, units[num_units++] = vmw_crtc_to_du(crtc); } - BUG_ON(surf == NULL); BUG_ON(!clips || !num_clips); fifo_size = sizeof(*cmd) + sizeof(SVGASignedRect) * num_clips; @@ -476,7 +474,6 @@ int vmw_framebuffer_surface_dirty(struct drm_framebuffer *framebuffer, struct vmw_master *vmaster = vmw_master(file_priv->master); struct vmw_framebuffer_surface *vfbs = vmw_framebuffer_to_vfbs(framebuffer); - struct vmw_surface *surf = vfbs->surface; struct drm_clip_rect norect; int ret, inc = 1; @@ -502,7 +499,7 @@ int vmw_framebuffer_surface_dirty(struct drm_framebuffer *framebuffer, inc = 2; /* skip source rects */ } - ret = do_surface_dirty_sou(dev_priv, file_priv, &vfbs->base, surf, + ret = do_surface_dirty_sou(dev_priv, file_priv, &vfbs->base, flags, color, clips, num_clips, inc); @@ -642,7 +639,6 @@ void vmw_framebuffer_dmabuf_destroy(struct drm_framebuffer *framebuffer) static int do_dmabuf_dirty_ldu(struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer, - struct vmw_dma_buffer *buffer, unsigned flags, unsigned color, struct drm_clip_rect *clips, unsigned num_clips, int increment) @@ -722,7 +718,6 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, static int do_dmabuf_dirty_sou(struct drm_file *file_priv, struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer, - struct vmw_dma_buffer *buffer, unsigned flags, unsigned color, struct drm_clip_rect *clips, unsigned num_clips, int increment) @@ -811,7 +806,6 @@ int vmw_framebuffer_dmabuf_dirty(struct drm_framebuffer *framebuffer, struct vmw_master *vmaster = vmw_master(file_priv->master); struct vmw_framebuffer_dmabuf *vfbd = vmw_framebuffer_to_vfbd(framebuffer); - struct vmw_dma_buffer *dmabuf = vfbd->buffer; struct drm_clip_rect norect; int ret, increment = 1; @@ -831,12 +825,12 @@ int vmw_framebuffer_dmabuf_dirty(struct drm_framebuffer *framebuffer, } if (dev_priv->ldu_priv) { - ret = do_dmabuf_dirty_ldu(dev_priv, &vfbd->base, dmabuf, + ret = do_dmabuf_dirty_ldu(dev_priv, &vfbd->base, flags, color, clips, num_clips, increment); } else { ret = do_dmabuf_dirty_sou(file_priv, dev_priv, &vfbd->base, - dmabuf, flags, color, + flags, color, clips, num_clips, increment); } -- 1.7.4.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers 2011-10-22 8:29 [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Thomas Hellstrom 2011-10-22 8:29 ` [PATCH 2/2] vmwgfx: Don't pass unused arguments to do_dirty functions Thomas Hellstrom @ 2011-10-24 21:25 ` Konrad Rzeszutek Wilk 2011-10-24 22:01 ` Jakob Bornecrantz 1 sibling, 1 reply; 5+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-10-24 21:25 UTC (permalink / raw) To: Thomas Hellstrom; +Cc: dri-devel On Sat, Oct 22, 2011 at 10:29:33AM +0200, Thomas Hellstrom wrote: > From: Jakob Bornecrantz <jakob@vmware.com> > > Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> > Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> > --- > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 10 +++++++++- > 1 files changed, 9 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > index 39b99db..00ec619 100644 > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > @@ -679,6 +679,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, > struct vmw_private *dev_priv, > struct vmw_framebuffer *framebuffer) > { > + int depth = framebuffer->base.depth; > size_t fifo_size; > int ret; > > @@ -687,6 +688,13 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, > SVGAFifoCmdDefineGMRFB body; > } *cmd; > > + /* Emulate RGBA support, contrary to svga_reg.h this is not > + * supported by hosts. This is only a problem if we are reading Uh, what if it becomes supported at some point? Should there be some check against the host version? (Thinking that some user might be running this older driver with a newer host that des support 32 - won't that cause issues?) > + * this value later and expecting what we uploaded back. > + */ > + if (depth == 32) > + depth = 24; > + > fifo_size = sizeof(*cmd); > cmd = kmalloc(fifo_size, GFP_KERNEL); > if (unlikely(cmd == NULL)) { > @@ -697,7 +705,7 @@ static int do_dmabuf_define_gmrfb(struct drm_file *file_priv, > memset(cmd, 0, fifo_size); > cmd->header = SVGA_CMD_DEFINE_GMRFB; > cmd->body.format.bitsPerPixel = framebuffer->base.bits_per_pixel; > - cmd->body.format.colorDepth = framebuffer->base.depth; > + cmd->body.format.colorDepth = depth; > cmd->body.format.reserved = 0; > cmd->body.bytesPerLine = framebuffer->base.pitch; > cmd->body.ptr.gmrId = framebuffer->user_handle; > -- > 1.7.4.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers 2011-10-24 21:25 ` [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Konrad Rzeszutek Wilk @ 2011-10-24 22:01 ` Jakob Bornecrantz 2011-10-24 22:20 ` Konrad Rzeszutek Wilk 0 siblings, 1 reply; 5+ messages in thread From: Jakob Bornecrantz @ 2011-10-24 22:01 UTC (permalink / raw) To: Konrad Rzeszutek Wilk; +Cc: Thomas Hellstrom, dri-devel ----- Original Message ----- > On Sat, Oct 22, 2011 at 10:29:33AM +0200, Thomas Hellstrom wrote: > > From: Jakob Bornecrantz <jakob@vmware.com> > > > > Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> > > Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> > > --- > > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 10 +++++++++- > > 1 files changed, 9 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > index 39b99db..00ec619 100644 > > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > @@ -679,6 +679,7 @@ static int do_dmabuf_define_gmrfb(struct > > drm_file *file_priv, > > struct vmw_private *dev_priv, > > struct vmw_framebuffer *framebuffer) > > { > > + int depth = framebuffer->base.depth; > > size_t fifo_size; > > int ret; > > > > @@ -687,6 +688,13 @@ static int do_dmabuf_define_gmrfb(struct > > drm_file *file_priv, > > SVGAFifoCmdDefineGMRFB body; > > } *cmd; > > > > + /* Emulate RGBA support, contrary to svga_reg.h this is not > > + * supported by hosts. This is only a problem if we are reading > > Uh, what if it becomes supported at some point? Should there be some > check against the host version? > > (Thinking that some user might be running this older driver with a > newer host that des support 32 - won't that cause issues?) We can add a check then, from the point of view of userspace 32 bit framebuffers works fine. The problem is with the readback ioctl where the readback pixels alpha will be clobbered. We also don't support depths of 30 R10G10B10X2. If we add support for depth 32 and/or depth 30 formats we can add params to tell userspace about that, right now there isn't really a point to them since they will always return not supported and we need to do any work around in userspace anyways. Cheers, Jakob. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers 2011-10-24 22:01 ` Jakob Bornecrantz @ 2011-10-24 22:20 ` Konrad Rzeszutek Wilk 0 siblings, 0 replies; 5+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-10-24 22:20 UTC (permalink / raw) To: Jakob Bornecrantz; +Cc: Thomas Hellstrom, dri-devel On Mon, Oct 24, 2011 at 03:01:23PM -0700, Jakob Bornecrantz wrote: > > ----- Original Message ----- > > On Sat, Oct 22, 2011 at 10:29:33AM +0200, Thomas Hellstrom wrote: > > > From: Jakob Bornecrantz <jakob@vmware.com> > > > > > > Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> > > > Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> > > > --- > > > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 10 +++++++++- > > > 1 files changed, 9 insertions(+), 1 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > > b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > > index 39b99db..00ec619 100644 > > > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c > > > @@ -679,6 +679,7 @@ static int do_dmabuf_define_gmrfb(struct > > > drm_file *file_priv, > > > struct vmw_private *dev_priv, > > > struct vmw_framebuffer *framebuffer) > > > { > > > + int depth = framebuffer->base.depth; > > > size_t fifo_size; > > > int ret; > > > > > > @@ -687,6 +688,13 @@ static int do_dmabuf_define_gmrfb(struct > > > drm_file *file_priv, > > > SVGAFifoCmdDefineGMRFB body; > > > } *cmd; > > > > > > + /* Emulate RGBA support, contrary to svga_reg.h this is not > > > + * supported by hosts. This is only a problem if we are reading > > > > Uh, what if it becomes supported at some point? Should there be some > > check against the host version? > > > > (Thinking that some user might be running this older driver with a > > newer host that des support 32 - won't that cause issues?) > > We can add a check then, from the point of view of userspace 32 bit > framebuffers works fine. The problem is with the readback ioctl where > the readback pixels alpha will be clobbered. We also don't support > depths of 30 R10G10B10X2. > > If we add support for depth 32 and/or depth 30 formats we can add > params to tell userspace about that, right now there isn't really a > point to them since they will always return not supported and we > need to do any work around in userspace anyways. <nods> sounds reasonable. > > Cheers, Jakob. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-24 22:20 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-10-22 8:29 [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Thomas Hellstrom 2011-10-22 8:29 ` [PATCH 2/2] vmwgfx: Don't pass unused arguments to do_dirty functions Thomas Hellstrom 2011-10-24 21:25 ` [PATCH 1/2] vmwgfx: Emulate depth 32 framebuffers Konrad Rzeszutek Wilk 2011-10-24 22:01 ` Jakob Bornecrantz 2011-10-24 22:20 ` Konrad Rzeszutek Wilk
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.