Home | History | Annotate | Line # | Download | only in nouveau
      1  1.2  riastrad /*	$NetBSD: nouveau_crtc.h,v 1.3 2021/12/18 23:45:32 riastradh Exp $	*/
      2  1.2  riastrad 
      3  1.1  riastrad /*
      4  1.1  riastrad  * Copyright (C) 2008 Maarten Maathuis.
      5  1.1  riastrad  * All Rights Reserved.
      6  1.1  riastrad  *
      7  1.1  riastrad  * Permission is hereby granted, free of charge, to any person obtaining
      8  1.1  riastrad  * a copy of this software and associated documentation files (the
      9  1.1  riastrad  * "Software"), to deal in the Software without restriction, including
     10  1.1  riastrad  * without limitation the rights to use, copy, modify, merge, publish,
     11  1.1  riastrad  * distribute, sublicense, and/or sell copies of the Software, and to
     12  1.1  riastrad  * permit persons to whom the Software is furnished to do so, subject to
     13  1.1  riastrad  * the following conditions:
     14  1.1  riastrad  *
     15  1.1  riastrad  * The above copyright notice and this permission notice (including the
     16  1.1  riastrad  * next paragraph) shall be included in all copies or substantial
     17  1.1  riastrad  * portions of the Software.
     18  1.1  riastrad  *
     19  1.1  riastrad  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     20  1.1  riastrad  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     21  1.1  riastrad  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     22  1.1  riastrad  * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
     23  1.1  riastrad  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
     24  1.1  riastrad  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     25  1.1  riastrad  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     26  1.1  riastrad  *
     27  1.1  riastrad  */
     28  1.1  riastrad 
     29  1.1  riastrad #ifndef __NOUVEAU_CRTC_H__
     30  1.1  riastrad #define __NOUVEAU_CRTC_H__
     31  1.1  riastrad 
     32  1.3  riastrad #include <drm/drm_crtc.h>
     33  1.3  riastrad 
     34  1.2  riastrad #include <nvif/notify.h>
     35  1.2  riastrad 
     36  1.1  riastrad struct nouveau_crtc {
     37  1.1  riastrad 	struct drm_crtc base;
     38  1.1  riastrad 
     39  1.1  riastrad 	int index;
     40  1.2  riastrad 	struct nvif_notify vblank;
     41  1.1  riastrad 
     42  1.1  riastrad 	uint32_t dpms_saved_fp_control;
     43  1.1  riastrad 	uint32_t fp_users;
     44  1.1  riastrad 	int saturation;
     45  1.1  riastrad 	int sharpness;
     46  1.1  riastrad 	int last_dpms;
     47  1.1  riastrad 
     48  1.1  riastrad 	int cursor_saved_x, cursor_saved_y;
     49  1.1  riastrad 
     50  1.1  riastrad 	struct {
     51  1.1  riastrad 		int cpp;
     52  1.1  riastrad 		bool blanked;
     53  1.1  riastrad 		uint32_t offset;
     54  1.2  riastrad 		uint32_t handle;
     55  1.1  riastrad 	} fb;
     56  1.1  riastrad 
     57  1.1  riastrad 	struct {
     58  1.1  riastrad 		struct nouveau_bo *nvbo;
     59  1.1  riastrad 		uint32_t offset;
     60  1.1  riastrad 		void (*set_offset)(struct nouveau_crtc *, uint32_t offset);
     61  1.1  riastrad 		void (*set_pos)(struct nouveau_crtc *, int x, int y);
     62  1.1  riastrad 		void (*hide)(struct nouveau_crtc *, bool update);
     63  1.1  riastrad 		void (*show)(struct nouveau_crtc *, bool update);
     64  1.1  riastrad 	} cursor;
     65  1.1  riastrad 
     66  1.1  riastrad 	struct {
     67  1.1  riastrad 		int depth;
     68  1.1  riastrad 	} lut;
     69  1.1  riastrad 
     70  1.3  riastrad 	void (*save)(struct drm_crtc *crtc);
     71  1.3  riastrad 	void (*restore)(struct drm_crtc *crtc);
     72  1.1  riastrad };
     73  1.1  riastrad 
     74  1.1  riastrad static inline struct nouveau_crtc *nouveau_crtc(struct drm_crtc *crtc)
     75  1.1  riastrad {
     76  1.2  riastrad 	return crtc ? container_of(crtc, struct nouveau_crtc, base) : NULL;
     77  1.1  riastrad }
     78  1.1  riastrad 
     79  1.1  riastrad static inline struct drm_crtc *to_drm_crtc(struct nouveau_crtc *crtc)
     80  1.1  riastrad {
     81  1.1  riastrad 	return &crtc->base;
     82  1.1  riastrad }
     83  1.1  riastrad 
     84  1.1  riastrad int nv04_cursor_init(struct nouveau_crtc *);
     85  1.1  riastrad 
     86  1.1  riastrad #endif /* __NOUVEAU_CRTC_H__ */
     87