2010/2/12 Ian Romanick <i...@freedesktop.org>: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Kristian Høgsberg wrote: > > It's not obvious why this is necessary. Is it to prevent multiple calls > to eglCreateImage from creating multiple regions for the same bo? Some > explanation in intel_region_alloc_for_handle would be helpful to people > like me that aren't as familiar with some of the inner workings. :)
The problem that this fixes is the case where you create an EGLSurface and en EGLImage for a pixmap. In the first case, we end up creating a region for the gem handle through the intel_update_renderbuffers() path and in the second case the new intel_create_image_from_name() path. That will create different struct intel_regions for the same buffer, each with different drm_intel_bo's with different gem handles. That means that libdrm_intel can't properly track cache transitions for the buffer, since they will be associated with different drm_intel_bo's but it's the same underlying gem buffer. Also gem will either oops or return EINVAL (depending on how new your kernel is) if the same buffer appears several times with different handles in the execbuffer request. > Other than that and the trivial comment below, this looks good to me. > >> Signed-off-by: Kristian Høgsberg <k...@bitplanet.net> > > Reviewed-by: Ian Romanick <ian.d.roman...@intel.com> > >> --- >> src/mesa/drivers/dri/intel/intel_regions.c | 24 +++++++++++++++++++++++- >> src/mesa/drivers/dri/intel/intel_regions.h | 3 +++ >> src/mesa/drivers/dri/intel/intel_screen.c | 14 ++++++++++++++ >> src/mesa/drivers/dri/intel/intel_screen.h | 1 + >> 4 files changed, 41 insertions(+), 1 deletions(-) >> >> diff --git a/src/mesa/drivers/dri/intel/intel_regions.c >> b/src/mesa/drivers/dri/intel/intel_regions.c >> index e2859e4..881653f 100644 >> --- a/src/mesa/drivers/dri/intel/intel_regions.c >> +++ b/src/mesa/drivers/dri/intel/intel_regions.c >> @@ -42,6 +42,7 @@ >> #include <sys/ioctl.h> >> #include <errno.h> >> >> +#include <main/hash.h> > > You use "main/hash.h" intel_screen.c, and you should probably use the > same here. Yup, fixed. >> #include "intel_context.h" >> #include "intel_regions.h" >> #include "intel_blit.h" > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkt19xUACgkQX1gOwKyEAw93qACcCi2elsVlbMnzdpXJNxCMPHil > kGsAniguIshImur+LY2oQ0CY/snS3nIE > =0NG8 > -----END PGP SIGNATURE----- > thanks, Kristian ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev