1fa225cbcSrjs/*
2fa225cbcSrjs * Copyright © 2006 Intel Corporation
3fa225cbcSrjs *
4fa225cbcSrjs * Permission is hereby granted, free of charge, to any person obtaining a
5fa225cbcSrjs * copy of this software and associated documentation files (the "Software"),
6fa225cbcSrjs * to deal in the Software without restriction, including without limitation
7fa225cbcSrjs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8fa225cbcSrjs * and/or sell copies of the Software, and to permit persons to whom the
9fa225cbcSrjs * Software is furnished to do so, subject to the following conditions:
10fa225cbcSrjs *
11fa225cbcSrjs * The above copyright notice and this permission notice (including the next
12fa225cbcSrjs * paragraph) shall be included in all copies or substantial portions of the
13fa225cbcSrjs * Software.
14fa225cbcSrjs *
15fa225cbcSrjs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16fa225cbcSrjs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17fa225cbcSrjs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18fa225cbcSrjs * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19fa225cbcSrjs * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20fa225cbcSrjs * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21fa225cbcSrjs * SOFTWARE.
22fa225cbcSrjs *
23fa225cbcSrjs * Authors:
24fa225cbcSrjs *    Xiang Haihao <haihao.xiang@intel.com>
25fa225cbcSrjs *
26fa225cbcSrjs */
27fa225cbcSrjs#ifndef _I915_HWMC_H
28fa225cbcSrjs#define _I915_HWMC_H
29fa225cbcSrjs
30fa225cbcSrjs#include "i830_hwmc.h"
31fa225cbcSrjs
32fa225cbcSrjs/* i915 hw requires surface to be at least 1KB aligned */
33fa225cbcSrjs#define STRIDE(w)               (((w) + 0x3ff) & ~0x3ff)
34fa225cbcSrjs#define SIZE_Y420(w, h)         (h * STRIDE(w))
35fa225cbcSrjs#define SIZE_UV420(w, h)        ((h >> 1) * STRIDE(w >> 1))
36fa225cbcSrjs#define SIZE_YUV420(w, h)       (SIZE_Y420(w,h) + SIZE_UV420(w,h) * 2)
37fa225cbcSrjs#define SIZE_XX44(w, h)         (h * STRIDE(w))
38fa225cbcSrjs
39fa225cbcSrjs#define I915_NUM_XVMC_ATTRIBUTES       0x02
40fa225cbcSrjs#define I915_XVMC_VALID 0x80000000
41fa225cbcSrjs
42fa225cbcSrjstypedef struct
43fa225cbcSrjs{
44fa225cbcSrjs    struct _intel_xvmc_common comm;
45fa225cbcSrjs    unsigned int ctxno; /* XvMC private context reference number */
46fa225cbcSrjs    struct hwmc_buffer sis;
47fa225cbcSrjs    struct hwmc_buffer ssb;
48fa225cbcSrjs    struct hwmc_buffer msb;
49fa225cbcSrjs    struct hwmc_buffer psp;
50fa225cbcSrjs    struct hwmc_buffer psc;
51fa225cbcSrjs    struct hwmc_buffer corrdata;/* Correction Data Buffer */
52fa225cbcSrjs    int deviceID;
53fa225cbcSrjs} I915XvMCCreateContextRec;
54fa225cbcSrjs
55fa225cbcSrjstypedef struct
56fa225cbcSrjs{
57fa225cbcSrjs    unsigned int srfno;
58fa225cbcSrjs    struct hwmc_buffer srf;
59fa225cbcSrjs} I915XvMCCreateSurfaceRec;
60fa225cbcSrjs
61fa225cbcSrjs#endif /* _I915_HWMC_H */
62