101c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell/************************************************************************** 201c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * 301c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. 401c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * All Rights Reserved. 501c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * 601c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * Permission is hereby granted, free of charge, to any person obtaining a 701c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * copy of this software and associated documentation files (the 801c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * "Software"), to deal in the Software without restriction, including 901c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * without limitation the rights to use, copy, modify, merge, publish, 1001c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * distribute, sub license, and/or sell copies of the Software, and to 1101c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * permit persons to whom the Software is furnished to do so, subject to 1201c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * the following conditions: 1301c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * 1401c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * The above copyright notice and this permission notice (including the 1501c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * next paragraph) shall be included in all copies or substantial portions 1601c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * of the Software. 1701c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * 1801c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1901c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2001c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 2101c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 2201c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 2301c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 2401c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2501c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell * 2601c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell **************************************************************************/ 2701c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell 2801c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell#ifndef I915_BATCH_H 2901c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell#define I915_BATCH_H 3001c35b52a1fccbe4253a96b9c0506ef6c991e44fKeith Whitwell 31bc88c95990f871a206a8fe93e7541f1f41841f7eJakob Bornecrantz#include "i915_batchbuffer.h" 32e53b41f2632af26c79c4f7ed5b0fdb86a1feb602Stéphane Marchesin#include "i915_context.h" 3393d5cfd8b7c641c5656aed38ad2f9559e09502f0Keith Whitwell 3457fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz 358f9e546fde27db75ea87bcf8ae333bc70616deb4Daniel Vetter#define BEGIN_BATCH(dwords) \ 368f9e546fde27db75ea87bcf8ae333bc70616deb4Daniel Vetter (i915_winsys_batchbuffer_check(i915->batch, dwords)) 374ee14279f3a466093869f1f40819e6c6d5af378dJakob Bornecrantz 38d2110064c2075a8537d4b7f87ba894ebaa6ccb33Jakob Bornecrantz#define OUT_BATCH(dword) \ 39bc88c95990f871a206a8fe93e7541f1f41841f7eJakob Bornecrantz i915_winsys_batchbuffer_dword(i915->batch, dword) 404ee14279f3a466093869f1f40819e6c6d5af378dJakob Bornecrantz 416358e6371b31671acbfa7c00336673f62ee928c5Daniel Vetter#define OUT_BATCH_F(f) \ 426358e6371b31671acbfa7c00336673f62ee928c5Daniel Vetter i915_winsys_batchbuffer_float(i915->batch, f) 436358e6371b31671acbfa7c00336673f62ee928c5Daniel Vetter 44d2110064c2075a8537d4b7f87ba894ebaa6ccb33Jakob Bornecrantz#define OUT_RELOC(buf, usage, offset) \ 45135b083461f8a5a220d86f57af018f6f0316d2bbDaniel Vetter i915_winsys_batchbuffer_reloc(i915->batch, buf, usage, offset, false) 46135b083461f8a5a220d86f57af018f6f0316d2bbDaniel Vetter 47135b083461f8a5a220d86f57af018f6f0316d2bbDaniel Vetter#define OUT_RELOC_FENCED(buf, usage, offset) \ 48135b083461f8a5a220d86f57af018f6f0316d2bbDaniel Vetter i915_winsys_batchbuffer_reloc(i915->batch, buf, usage, offset, true) 494ee14279f3a466093869f1f40819e6c6d5af378dJakob Bornecrantz 5057fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz#define FLUSH_BATCH(fence) \ 5157fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz i915_flush(i915, fence) 5257fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz 5357fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz/************************************************************************ 5457fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz * i915_flush.c 5557fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz */ 5657fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantzvoid i915_flush(struct i915_context *i915, struct pipe_fence_handle **fence); 5757fc2ad7a165bd969de5d1943e325db52f702eb8Jakob Bornecrantz 587cc23a9eaebc788ae34f6e06c6227524d08a7693Jakob Bornecrantz#endif 59