Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 2008 Maarten Maathuis.
0003  * All Rights Reserved.
0004  *
0005  * Permission is hereby granted, free of charge, to any person obtaining
0006  * a copy of this software and associated documentation files (the
0007  * "Software"), to deal in the Software without restriction, including
0008  * without limitation the rights to use, copy, modify, merge, publish,
0009  * distribute, sublicense, and/or sell copies of the Software, and to
0010  * permit persons to whom the Software is furnished to do so, subject to
0011  * the following conditions:
0012  *
0013  * The above copyright notice and this permission notice (including the
0014  * next paragraph) shall be included in all copies or substantial
0015  * portions of the Software.
0016  *
0017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0018  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0019  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
0020  * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
0021  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
0022  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
0023  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0024  *
0025  */
0026 
0027 #ifndef __NOUVEAU_CRTC_H__
0028 #define __NOUVEAU_CRTC_H__
0029 
0030 #include <drm/drm_crtc.h>
0031 
0032 #include <nvif/notify.h>
0033 
0034 struct nouveau_crtc {
0035     struct drm_crtc base;
0036 
0037     int index;
0038     struct nvif_notify vblank;
0039 
0040     uint32_t dpms_saved_fp_control;
0041     uint32_t fp_users;
0042     int saturation;
0043     int sharpness;
0044     int last_dpms;
0045 
0046     int cursor_saved_x, cursor_saved_y;
0047 
0048     struct {
0049         int cpp;
0050         bool blanked;
0051         uint32_t offset;
0052         uint32_t handle;
0053     } fb;
0054 
0055     struct {
0056         struct nouveau_bo *nvbo;
0057         uint32_t offset;
0058         void (*set_offset)(struct nouveau_crtc *, uint32_t offset);
0059         void (*set_pos)(struct nouveau_crtc *, int x, int y);
0060         void (*hide)(struct nouveau_crtc *, bool update);
0061         void (*show)(struct nouveau_crtc *, bool update);
0062     } cursor;
0063 
0064     struct {
0065         int depth;
0066     } lut;
0067 
0068     void (*save)(struct drm_crtc *crtc);
0069     void (*restore)(struct drm_crtc *crtc);
0070 };
0071 
0072 static inline struct nouveau_crtc *nouveau_crtc(struct drm_crtc *crtc)
0073 {
0074     return crtc ? container_of(crtc, struct nouveau_crtc, base) : NULL;
0075 }
0076 
0077 static inline struct drm_crtc *to_drm_crtc(struct nouveau_crtc *crtc)
0078 {
0079     return &crtc->base;
0080 }
0081 
0082 int nv04_cursor_init(struct nouveau_crtc *);
0083 
0084 #endif /* __NOUVEAU_CRTC_H__ */