Re: [Mesa-dev] [PATCH V2 00/17] Newbie Project : Enable ARB_map_buffer_alignment in all drivers
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/03/2013 10:44 AM, Eric Anholt wrote: Siavash Eliasi siavashser...@gmail.com writes: Hello, this is V2 series of patches to accomplish *Enable ARB_map_buffer_alignment in all drivers* newbie project suggested by Ian Romanick. I think there's a piece missing to this, which is this bit of spec text: If no error occurs, the pointer value returned by MapBufferRange must reflect an allocation aligned to the value of MIN_MAP_BUFFER_ALIGNMENT basic machine units. Subtracting offset basic machine units from the returned pointer will always produce a multiple of the value of MIN_MAP_BUFFER_ALIGNMENT. In i965's intel_bufferobj_map_range, range_map_bo or range_map_buffer mappings won't have that alignment. Yeah... I had forgotten about that when I originally posted the project. There are a couple ways we could handle it. The one that occurred to me first is to modify _mesa_MapBufferRange to only call ctx-Driver.MapBufferRange with a properly aligned offset (and do the fix-up on the pointer before storing it in gl_buffer_object::Pointer). We don't have to worry about gl_buffer_object::Offset being rounded because, as far as I can tell, it's not visible to applications. We'd just have to make sure that each driver's UnmapBuffer implementation only uses Offset and not Pointer. Does that sound sensible? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) iEYEARECAAYFAlKmLrIACgkQX1gOwKyEAw/xuACeKdD5Wxf5zW4B5O5tpoocDqI+ hw8An3i4KMkAAFZYAtayOY60GpxYyuFn =1xhS -END PGP SIGNATURE- ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH V2 00/17] Newbie Project : Enable ARB_map_buffer_alignment in all drivers
Ian Romanick i...@freedesktop.org writes: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/03/2013 10:44 AM, Eric Anholt wrote: Siavash Eliasi siavashser...@gmail.com writes: Hello, this is V2 series of patches to accomplish *Enable ARB_map_buffer_alignment in all drivers* newbie project suggested by Ian Romanick. I think there's a piece missing to this, which is this bit of spec text: If no error occurs, the pointer value returned by MapBufferRange must reflect an allocation aligned to the value of MIN_MAP_BUFFER_ALIGNMENT basic machine units. Subtracting offset basic machine units from the returned pointer will always produce a multiple of the value of MIN_MAP_BUFFER_ALIGNMENT. In i965's intel_bufferobj_map_range, range_map_bo or range_map_buffer mappings won't have that alignment. Yeah... I had forgotten about that when I originally posted the project. There are a couple ways we could handle it. The one that occurred to me first is to modify _mesa_MapBufferRange to only call ctx-Driver.MapBufferRange with a properly aligned offset (and do the fix-up on the pointer before storing it in gl_buffer_object::Pointer). We don't have to worry about gl_buffer_object::Offset being rounded because, as far as I can tell, it's not visible to applications. We'd just have to make sure that each driver's UnmapBuffer implementation only uses Offset and not Pointer. Does that sound sensible? No, because expanding someone's range with the INVALIDATE_RANGE flag would produce incorrect results. You just have to fix the implementations to know about the extension. pgpdQ8NfRXWFk.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH V2 00/17] Newbie Project : Enable ARB_map_buffer_alignment in all drivers
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/09/2013 04:58 PM, Eric Anholt wrote: Ian Romanick i...@freedesktop.org writes: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/03/2013 10:44 AM, Eric Anholt wrote: Siavash Eliasi siavashser...@gmail.com writes: Hello, this is V2 series of patches to accomplish *Enable ARB_map_buffer_alignment in all drivers* newbie project suggested by Ian Romanick. I think there's a piece missing to this, which is this bit of spec text: If no error occurs, the pointer value returned by MapBufferRange must reflect an allocation aligned to the value of MIN_MAP_BUFFER_ALIGNMENT basic machine units. Subtracting offset basic machine units from the returned pointer will always produce a multiple of the value of MIN_MAP_BUFFER_ALIGNMENT. In i965's intel_bufferobj_map_range, range_map_bo or range_map_buffer mappings won't have that alignment. Yeah... I had forgotten about that when I originally posted the project. There are a couple ways we could handle it. The one that occurred to me first is to modify _mesa_MapBufferRange to only call ctx-Driver.MapBufferRange with a properly aligned offset (and do the fix-up on the pointer before storing it in gl_buffer_object::Pointer). We don't have to worry about gl_buffer_object::Offset being rounded because, as far as I can tell, it's not visible to applications. We'd just have to make sure that each driver's UnmapBuffer implementation only uses Offset and not Pointer. Does that sound sensible? No, because expanding someone's range with the INVALIDATE_RANGE flag would produce incorrect results. Foo. Good catch. And the offset /is/ visible via glGetIntegerv(GL_BUFFER_MAP_OFFSET). I missed that on my first skim of the spec. You just have to fix the implementations to know about the extension. Right. I'll cook up a patch for the Intel classic drivers tomorrow. Looking at intel_bufferobj_map_range, it should be pretty trivial. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) iEYEARECAAYFAlKmb6EACgkQX1gOwKyEAw/71ACgi0bS1m5EKGjvpI4N4IqAZyzq cacAnjx1I0Rf4swgIV0KhuMBx4SUFQxc =+ppa -END PGP SIGNATURE- ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH V2 00/17] Newbie Project : Enable ARB_map_buffer_alignment in all drivers
Siavash Eliasi siavashser...@gmail.com writes: Hello, this is V2 series of patches to accomplish *Enable ARB_map_buffer_alignment in all drivers* newbie project suggested by Ian Romanick. I think there's a piece missing to this, which is this bit of spec text: If no error occurs, the pointer value returned by MapBufferRange must reflect an allocation aligned to the value of MIN_MAP_BUFFER_ALIGNMENT basic machine units. Subtracting offset basic machine units from the returned pointer will always produce a multiple of the value of MIN_MAP_BUFFER_ALIGNMENT. In i965's intel_bufferobj_map_range, range_map_bo or range_map_buffer mappings won't have that alignment. pgp1KgtzGANxM.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH V2 00/17] Newbie Project : Enable ARB_map_buffer_alignment in all drivers
Hi again, it's about one week these patches are receiving feedback and they (v2) look fine to reviewers. May I send a v3 for final review? Best regards, Siavash Eliasi. On 11/28/2013 12:26 PM, Siavash Eliasi wrote: Hello, this is V2 series of patches to accomplish *Enable ARB_map_buffer_alignment in all drivers* newbie project suggested by Ian Romanick. Revision 2: - Fixed setting switch cases prior to PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly. - Fixed memory leak. Best regards, Siavash Eliasi. Siavash Eliasi (17): softpipe: Modified allocation routine to use alignment of 64 instead of 16. softpipe: Modified softpipe to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. llvmpipe: Modified allocation routines to use alignment of 64 instead of 16. llvmpipe: Modified llvmpipe to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. i915: Modified i915_buffer_create to use memory allocation alignment of 64 instead of 16. i915: Modified i915g to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. svga: Modified svga to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. ilo: Modified ilo to return 4096 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. mesa: Modified Mesa state tracker to unconditionally enable ARB_map_buffer_alignment. mesa: Modified _mesa_init_constants to set ctx-Const.MinMapBufferAlignment to 64. mesa: Modified _mesa_buffer_data to use _mesa_align_malloc. radeon: Modified radeonBufferData to pass ctx-Const.MinMapBufferAlignment as the alignment value to radeon_bo_open. nouveau: Modified nouveau_bufferobj_data to pass ctx-Const.MinMapBufferAlignment as the alignment value to nouveau_bo_new. i915: Modified i915 intel_bufferobj_data to use _mesa_align_malloc instead of malloc. i965: Modified brw_initialize_context_constants to set ctx-Const.MinMapBufferAlignment to 4096. mesa: Modified extensions table to use o(dummy_true) instead of o(ARB_map_buffer_alignment). mesa: Deleted gl_extensions::ARB_map_buffer_alignment and all of its use cases. src/gallium/drivers/i915/i915_resource_buffer.c | 2 +- src/gallium/drivers/i915/i915_screen.c | 3 ++- src/gallium/drivers/ilo/ilo_screen.c| 2 +- src/gallium/drivers/llvmpipe/lp_screen.c| 3 ++- src/gallium/drivers/llvmpipe/lp_texture.c | 4 ++-- src/gallium/drivers/softpipe/sp_screen.c| 3 ++- src/gallium/drivers/softpipe/sp_texture.c | 2 +- src/gallium/drivers/svga/svga_screen.c | 3 ++- src/mesa/drivers/dri/i915/intel_buffer_objects.c| 4 ++-- src/mesa/drivers/dri/i965/brw_context.c | 2 ++ src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c| 3 ++- src/mesa/drivers/dri/radeon/radeon_buffer_objects.c | 2 +- src/mesa/main/bufferobj.c | 7 +-- src/mesa/main/context.c | 1 + src/mesa/main/extensions.c | 2 +- src/mesa/main/get.c | 1 - src/mesa/main/get_hash_params.py| 2 +- src/mesa/main/mtypes.h | 1 - src/mesa/state_tracker/st_extensions.c | 4 +--- 19 files changed, 29 insertions(+), 22 deletions(-) ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH V2 00/17] Newbie Project : Enable ARB_map_buffer_alignment in all drivers
Hello, this is V2 series of patches to accomplish *Enable ARB_map_buffer_alignment in all drivers* newbie project suggested by Ian Romanick. Revision 2: - Fixed setting switch cases prior to PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly. - Fixed memory leak. Best regards, Siavash Eliasi. Siavash Eliasi (17): softpipe: Modified allocation routine to use alignment of 64 instead of 16. softpipe: Modified softpipe to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. llvmpipe: Modified allocation routines to use alignment of 64 instead of 16. llvmpipe: Modified llvmpipe to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. i915: Modified i915_buffer_create to use memory allocation alignment of 64 instead of 16. i915: Modified i915g to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. svga: Modified svga to return 64 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. ilo: Modified ilo to return 4096 in case of PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT. mesa: Modified Mesa state tracker to unconditionally enable ARB_map_buffer_alignment. mesa: Modified _mesa_init_constants to set ctx-Const.MinMapBufferAlignment to 64. mesa: Modified _mesa_buffer_data to use _mesa_align_malloc. radeon: Modified radeonBufferData to pass ctx-Const.MinMapBufferAlignment as the alignment value to radeon_bo_open. nouveau: Modified nouveau_bufferobj_data to pass ctx-Const.MinMapBufferAlignment as the alignment value to nouveau_bo_new. i915: Modified i915 intel_bufferobj_data to use _mesa_align_malloc instead of malloc. i965: Modified brw_initialize_context_constants to set ctx-Const.MinMapBufferAlignment to 4096. mesa: Modified extensions table to use o(dummy_true) instead of o(ARB_map_buffer_alignment). mesa: Deleted gl_extensions::ARB_map_buffer_alignment and all of its use cases. src/gallium/drivers/i915/i915_resource_buffer.c | 2 +- src/gallium/drivers/i915/i915_screen.c | 3 ++- src/gallium/drivers/ilo/ilo_screen.c| 2 +- src/gallium/drivers/llvmpipe/lp_screen.c| 3 ++- src/gallium/drivers/llvmpipe/lp_texture.c | 4 ++-- src/gallium/drivers/softpipe/sp_screen.c| 3 ++- src/gallium/drivers/softpipe/sp_texture.c | 2 +- src/gallium/drivers/svga/svga_screen.c | 3 ++- src/mesa/drivers/dri/i915/intel_buffer_objects.c| 4 ++-- src/mesa/drivers/dri/i965/brw_context.c | 2 ++ src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c| 3 ++- src/mesa/drivers/dri/radeon/radeon_buffer_objects.c | 2 +- src/mesa/main/bufferobj.c | 7 +-- src/mesa/main/context.c | 1 + src/mesa/main/extensions.c | 2 +- src/mesa/main/get.c | 1 - src/mesa/main/get_hash_params.py| 2 +- src/mesa/main/mtypes.h | 1 - src/mesa/state_tracker/st_extensions.c | 4 +--- 19 files changed, 29 insertions(+), 22 deletions(-) -- 1.8.4.2 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev