/* * Copyright 2011 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * on the rights to use, copy, modify, merge, publish, distribute, sub * license, and/or sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <linux/iosys-map.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> #include "qxl_drv.h" #include "qxl_object.h" static int alloc_clips(struct qxl_device *qdev, struct qxl_release *release, unsigned int num_clips, struct qxl_bo **clips_bo) { … } /* returns a pointer to the already allocated qxl_rect array inside * the qxl_clip_rects. This is *not* the same as the memory allocated * on the device, it is offset to qxl_clip_rects.chunk.data */ static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev, unsigned int num_clips, struct qxl_bo *clips_bo) { … } static int alloc_drawable(struct qxl_device *qdev, struct qxl_release **release) { … } static void free_drawable(struct qxl_device *qdev, struct qxl_release *release) { … } /* release needs to be reserved at this point */ static int make_drawable(struct qxl_device *qdev, int surface, uint8_t type, const struct qxl_rect *rect, struct qxl_release *release) { … } /* push a draw command using the given clipping rectangles as * the sources from the shadow framebuffer. * * Right now implementing with a single draw and a clip list. Clip * lists are known to be a problem performance wise, this can be solved * by treating them differently in the server. */ void qxl_draw_dirty_fb(struct qxl_device *qdev, struct drm_framebuffer *fb, struct qxl_bo *bo, unsigned int flags, unsigned int color, struct drm_clip_rect *clips, unsigned int num_clips, int inc, uint32_t dumb_shadow_offset) { … }