drmmode_display.h revision ad43ddac
1/* 2 * Copyright © 2007 Red Hat, Inc. 3 * 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: 10 * 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 13 * Software. 14 * 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 21 * SOFTWARE. 22 * 23 * Authors: 24 * Dave Airlie <airlied@redhat.com> 25 * 26 */ 27#ifndef DRMMODE_DISPLAY_H 28#define DRMMODE_DISPLAY_H 29 30#ifdef XF86DRM_MODE 31 32#include "xf86drmMode.h" 33 34#include "radeon_probe.h" 35 36typedef struct { 37 int fd; 38 unsigned fb_id; 39 drmModeResPtr mode_res; 40 drmModeFBPtr mode_fb; 41 int cpp; 42 struct radeon_bo_manager *bufmgr; 43} drmmode_rec, *drmmode_ptr; 44 45typedef struct { 46 47 drmmode_ptr drmmode; 48 drmModeCrtcPtr mode_crtc; 49 struct radeon_bo *cursor_bo; 50 struct radeon_bo *rotate_bo; 51 unsigned rotate_fb_id; 52 uint16_t lut_r[256], lut_g[256], lut_b[256]; 53} drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; 54 55typedef struct { 56 drmModePropertyPtr mode_prop; 57 uint64_t value; 58 int num_atoms; /* if range prop, num_atoms == 1; if enum prop, num_atoms == num_enums + 1 */ 59 Atom *atoms; 60} drmmode_prop_rec, *drmmode_prop_ptr; 61 62 63typedef struct { 64 drmmode_ptr drmmode; 65 int output_id; 66 drmModeConnectorPtr mode_output; 67 drmModeEncoderPtr *mode_encoders; 68 drmModePropertyBlobPtr edid_blob; 69 int dpms_enum_id; 70 int num_props; 71 drmmode_prop_ptr props; 72 int enc_mask; 73 int enc_clone_mask; 74} drmmode_output_private_rec, *drmmode_output_private_ptr; 75 76 77extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); 78extern Bool drmmode_set_bufmgr(ScrnInfoPtr pScrn, drmmode_ptr drmmode, struct radeon_bo_manager *bufmgr); 79extern void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id, struct radeon_bo *bo); 80void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y, int flags); 81extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode); 82extern void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode); 83extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); 84#endif 85 86#endif 87