2
* Copyright (c) 2011 Intel Corporation
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
* copy of this software and associated documentation files (the "Software"),
6
* to deal in the Software without restriction, including without limitation
7
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
* and/or sell copies of the Software, and to permit persons to whom the
9
* Software is furnished to do so, subject to the following conditions:
11
* The above copyright notice and this permission notice (including the next
12
* paragraph) shall be included in all copies or substantial portions of the
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
* Chris Wilson <chris@chris-wilson.co.uk>
36
#define DBG(x) ErrorF x
42
memcpy_blt(const void *src, void *dst, int bpp,
43
uint16_t src_stride, uint16_t dst_stride,
44
int16_t src_x, int16_t src_y,
45
int16_t dst_x, int16_t dst_y,
46
uint16_t width, uint16_t height)
51
assert(width && height);
54
DBG(("%s: src=(%d, %d), dst=(%d, %d), size=%dx%d, pitch=%d/%d\n",
55
__FUNCTION__, src_x, src_y, dst_x, dst_y, width, height, src_stride, dst_stride));
60
src_bytes = (uint8_t *)src + src_stride * src_y + src_x * bpp;
61
dst_bytes = (uint8_t *)dst + dst_stride * dst_y + dst_x * bpp;
63
if (width == src_stride && width == dst_stride) {
64
memcpy(dst_bytes, src_bytes, width * height);
69
memcpy(dst_bytes, src_bytes, width);
70
src_bytes += src_stride;
71
dst_bytes += dst_stride;