<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 24, 2014 at 2:05 AM, Thomas Hellstrom <span dir="ltr"><<a href="mailto:thellstrom@vmware.com" target="_blank">thellstrom@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This avoids the kernel driver spewing out errors about the param not being<br>
supported.<br>
<br>
Also correct the max surface size used when the kernel does not support the<br>
query.<br>
<br>
Reported-by: Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>><br>
Signed-off-by: Thomas Hellstrom <<a href="mailto:thellstrom@vmware.com">thellstrom@vmware.com</a>><br>
Reviewed-by: Charmaine Lee <<a href="mailto:charmainel@vmware.com">charmainel@vmware.com</a>><br>
Cc: "10.1" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
---<br>
src/gallium/winsys/svga/drm/vmw_screen_ioctl.c | 15 ++++++++-------<br>
1 file changed, 8 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c<br>
index b7bedb1..2866a29 100644<br>
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c<br>
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c<br>
@@ -762,7 +762,7 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)<br>
int ret;<br>
uint32_t *cap_buffer;<br>
drmVersionPtr version;<br>
- boolean drm_gb_capable;<br>
+ boolean have_drm_2_5;<br>
<br>
VMW_FUNC;<br>
<br>
@@ -770,7 +770,7 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)<br>
if (!version)<br>
goto out_no_version;<br>
<br>
- drm_gb_capable = version->version_major > 2 ||<br>
+ have_drm_2_5 = version->version_major > 2 ||<br>
(version->version_major == 2 && version->version_minor > 4);<br></blockquote><div><br></div><div>How about something like:<br><br>have_drm_2_5 = version->version_major * 100 + version->version_minor >= 205?<br>
<br>Not a big deal though. Thanks for fixing this.<br><br></div><div>Reviewed-by: Brian Paul <<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>><br><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
memset(&gp_arg, 0, sizeof(gp_arg));<br>
@@ -803,7 +803,7 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)<br>
vws->base.have_gb_objects =<br>
!!(gp_arg.value & (uint64_t) SVGA_CAP_GBOBJECTS);<br>
<br>
- if (vws->base.have_gb_objects && !drm_gb_capable)<br>
+ if (vws->base.have_gb_objects && !have_drm_2_5)<br>
goto out_no_3d;<br>
<br>
if (vws->base.have_gb_objects) {<br>
@@ -839,11 +839,12 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)<br>
<br>
memset(&gp_arg, 0, sizeof(gp_arg));<br>
gp_arg.param = DRM_VMW_PARAM_MAX_SURF_MEMORY;<br>
- ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_GET_PARAM,<br>
- &gp_arg, sizeof(gp_arg));<br>
- if (ret) {<br>
+ if (have_drm_2_5)<br>
+ ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_GET_PARAM,<br>
+ &gp_arg, sizeof(gp_arg));<br>
+ if (!have_drm_2_5 || ret) {<br>
/* Just guess a large enough value, around 800mb. */<br>
- vws->ioctl.max_surface_memory = 0x300000000;<br>
+ vws->ioctl.max_surface_memory = 0x30000000;<br>
} else {<br>
vws->ioctl.max_surface_memory = gp_arg.value;<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.10.4<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>