neuswc

patched neuswc library (tracked)
git clone https://git.daat.foo/neuswc.git
Log | Files | Refs | README | LICENSE

primary_plane.h (2105B)


      1 /* swc: libswc/primary_plane.h
      2  *
      3  * Copyright (c) 2013, 2016 Michael Forney
      4  *
      5  * Permission is hereby granted, free of charge, to any person obtaining a copy
      6  * of this software and associated documentation files (the "Software"), to deal
      7  * in the Software without restriction, including without limitation the rights
      8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      9  * copies of the Software, and to permit persons to whom the Software is
     10  * furnished to do so, subject to the following conditions:
     11  *
     12  * The above copyright notice and this permission notice shall be included in
     13  * all copies or substantial portions of the 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 THE
     18  * 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 
     24 #ifndef SWC_PRIMARY_PLANE_H
     25 #define SWC_PRIMARY_PLANE_H
     26 
     27 #include "mode.h"
     28 #include "view.h"
     29 #ifdef ENABLE_DRM
     30 #include "drm.h"
     31 #endif
     32 
     33 #include <stdbool.h>
     34 #include <stdint.h>
     35 #include <wayland-server.h>
     36 
     37 struct primary_plane {
     38 #ifdef ENABLE_DRM
     39 	/* driven through drm, not the framebuffer */
     40 	bool drm;
     41 	uint32_t crtc;
     42 	drmModeCrtcPtr original_crtc_state;
     43 #endif
     44 	struct mode mode;
     45 	struct view view;
     46 #ifdef ENABLE_DRM
     47 	struct wl_array connectors;
     48 	bool need_modeset;
     49 	struct drm_handler drm_handler;
     50 #endif
     51 	struct wl_listener swc_listener;
     52 };
     53 
     54 #ifdef ENABLE_DRM
     55 bool
     56 primary_plane_initialize_drm(struct primary_plane *plane, uint32_t crtc,
     57                              struct mode *mode, uint32_t *connectors,
     58                              uint32_t num_connectors);
     59 #endif
     60 #ifdef ENABLE_FB
     61 bool
     62 primary_plane_initialize_fb(struct primary_plane *plane, struct mode *mode);
     63 #endif
     64 void
     65 primary_plane_finalize(struct primary_plane *plane);
     66 
     67 #endif