On 11/08/2013 10:49 AM, Eric Anholt wrote: > No depending on unreleased code. > --- > src/mesa/drivers/dri/i965/brw_context.c | 8 +++----- > src/mesa/drivers/dri/i965/brw_reset.c | 7 +++++++ > 2 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_context.c > b/src/mesa/drivers/dri/i965/brw_context.c > index a33e993..bee98e3 100644 > --- a/src/mesa/drivers/dri/i965/brw_context.c > +++ b/src/mesa/drivers/dri/i965/brw_context.c > @@ -714,12 +714,10 @@ brwCreateContext(gl_api api, > } > > /* Notification of GPU resets requires hardware contexts and a kernel new > - * enough to support DRM_IOCTL_I915_GET_RESET_STATS. > + * enough to support DRM_IOCTL_I915_GET_RESET_STATS, which isn't upstream > + * yet. > */ > - if (notify_reset && > - (brw->hw_ctx == NULL > - || drm_intel_get_reset_stats(brw->hw_ctx, &brw->reset_count, NULL, > - NULL))) { > + if (notify_reset) {
If anything, this should #if around DRM_IOCTL_I915_GET_RESET_STATS being defined. If that's not defined, then the DRI extension shouldn't be enabled. if (notify_reset #ifdef DRM_IOCTL_I915_GET_RESET_STATS && (brw->hw_ctx == NULL || drm_intel_get_reset_stats(brw->hw_ctx, &brw->reset_count, NULL, NULL)) #endif ) { Then we don't have to revert this patch when libdrm bits (re-)land. And add #ifdef DRM_IOCTL_I915_GET_RESET_STATS around the dri2Robustness stuff in intel_screen.c. > /* This is the wrong error code, but the correct error code (one that > * will cause EGL to generate EGL_BAD_MATCH) doesn't seem to exist. > */ > diff --git a/src/mesa/drivers/dri/i965/brw_reset.c > b/src/mesa/drivers/dri/i965/brw_reset.c > index 7eca1bc..e93b2e2 100644 > --- a/src/mesa/drivers/dri/i965/brw_reset.c > +++ b/src/mesa/drivers/dri/i965/brw_reset.c > @@ -42,10 +42,17 @@ brw_get_graphics_reset_status(struct gl_context *ctx) > */ > assert(brw->hw_ctx != NULL); > > +#if 0 #ifdef DRM_IOCTL_I915_GET_RESET_STATS > + /* This is waiting until the kernel code can be merged and a new libdrm > + * actually released. > + */ > err = drm_intel_get_reset_stats(brw->hw_ctx, &reset_count, &active, > &pending); > if (err) > return GL_NO_ERROR; > +#else > + return GL_NO_ERROR; > +#endif > > /* A reset was observed while a batch from this context was executing. > * Assume that this context was at fault. > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev