XenevaOS
Loading...
Searching...
No Matches
drm_modeset_helper_vtables.h
Go to the documentation of this file.
1/*
2 * Copyright © 2006 Keith Packard
3 * Copyright © 2007-2008 Dave Airlie
4 * Copyright © 2007-2008 Intel Corporation
5 * Jesse Barnes <jesse.barnes@intel.com>
6 * Copyright © 2011-2013 Intel Corporation
7 * Copyright © 2015 Intel Corporation
8 * Daniel Vetter <daniel.vetter@ffwll.ch>
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 *
17 * The above copyright notice and this permission notice shall be included in
18 * all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */
28
29#ifndef __DRM_MODESET_HELPER_VTABLES_H__
30#define __DRM_MODESET_HELPER_VTABLES_H__
31
32#include <drm/drm_crtc.h>
33#include <drm/drm_encoder.h>
34
54
78 void (*dpms)(struct drm_crtc *crtc, int mode);
79
93 void (*prepare)(struct drm_crtc *crtc);
94
108 void (*commit)(struct drm_crtc *crtc);
109
141 enum drm_mode_status (*mode_valid)(struct drm_crtc *crtc,
142 const struct drm_display_mode *mode);
143
188 const struct drm_display_mode *mode,
189 struct drm_display_mode *adjusted_mode);
190
206 int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
207 struct drm_display_mode *adjusted_mode, int x, int y,
208 struct drm_framebuffer *old_fb);
209
229 void (*mode_set_nofb)(struct drm_crtc *crtc);
230
248 int (*mode_set_base)(struct drm_crtc *crtc, int x, int y,
249 struct drm_framebuffer *old_fb);
250
282 void (*disable)(struct drm_crtc *crtc);
283
334 int (*atomic_check)(struct drm_crtc *crtc,
335 struct drm_atomic_commit *state);
336
355 void (*atomic_begin)(struct drm_crtc *crtc,
356 struct drm_atomic_commit *state);
379 void (*atomic_flush)(struct drm_crtc *crtc,
380 struct drm_atomic_commit *state);
381
401 void (*atomic_enable)(struct drm_crtc *crtc,
402 struct drm_atomic_commit *state);
403
421 void (*atomic_disable)(struct drm_crtc *crtc,
422 struct drm_atomic_commit *state);
423
467 bool in_vblank_irq, int *vpos, int *hpos,
468 ktime_t *stime, ktime_t *etime,
469 const struct drm_display_mode *mode);
470
482};
483
489static inline void drm_crtc_helper_add(struct drm_crtc *crtc,
490 const struct drm_crtc_helper_funcs *funcs)
491{
493}
494
518 void (*dpms)(struct drm_encoder *encoder, int mode);
519
552 const struct drm_display_mode *mode);
553
595 const struct drm_display_mode *mode,
596 struct drm_display_mode *adjusted_mode);
597
611 void (*prepare)(struct drm_encoder *encoder);
612
626 void (*commit)(struct drm_encoder *encoder);
627
650 void (*mode_set)(struct drm_encoder *encoder,
651 struct drm_display_mode *mode,
652 struct drm_display_mode *adjusted_mode);
653
674 struct drm_crtc_state *crtc_state,
675 struct drm_connector_state *conn_state);
676
693 struct drm_connector *connector);
694
716 struct drm_atomic_commit *state);
717
739 struct drm_atomic_commit *state);
740
772 void (*disable)(struct drm_encoder *encoder);
773
790 void (*enable)(struct drm_encoder *encoder);
791
829 struct drm_crtc_state *crtc_state,
830 struct drm_connector_state *conn_state);
831};
832
838static inline void drm_encoder_helper_add(struct drm_encoder *encoder,
839 const struct drm_encoder_helper_funcs *funcs)
840{
842}
843
894 int (*get_modes)(struct drm_connector *connector);
895
920 int (*detect_ctx)(struct drm_connector *connector,
921 struct drm_modeset_acquire_ctx *ctx,
922 bool force);
923
958 enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
959 const struct drm_display_mode *mode);
960
997 int (*mode_valid_ctx)(struct drm_connector *connector,
998 const struct drm_display_mode *mode,
999 struct drm_modeset_acquire_ctx *ctx,
1000 enum drm_mode_status *status);
1001
1030 struct drm_encoder *(*best_encoder)(struct drm_connector *connector);
1031
1056 struct drm_encoder *(*atomic_best_encoder)(struct drm_connector *connector,
1057 struct drm_atomic_commit *state);
1058
1090 int (*atomic_check)(struct drm_connector *connector,
1091 struct drm_atomic_commit *state);
1092
1105 void (*atomic_commit)(struct drm_connector *connector,
1106 struct drm_atomic_commit *state);
1107
1123 struct drm_writeback_job *job);
1138 struct drm_writeback_job *job);
1139
1154 void (*enable_hpd)(struct drm_connector *connector);
1155
1170 void (*disable_hpd)(struct drm_connector *connector);
1171};
1172
1178static inline void drm_connector_helper_add(struct drm_connector *connector,
1179 const struct drm_connector_helper_funcs *funcs)
1180{
1181 connector->helper_private = funcs;
1182}
1183
1233 struct drm_plane_state *new_state);
1243 void (*cleanup_fb)(struct drm_plane *plane,
1244 struct drm_plane_state *old_state);
1245
1266 int (*begin_fb_access)(struct drm_plane *plane, struct drm_plane_state *new_plane_state);
1267
1274 void (*end_fb_access)(struct drm_plane *plane, struct drm_plane_state *new_plane_state);
1275
1312 struct drm_atomic_commit *state);
1313
1329 struct drm_atomic_commit *state);
1330
1354 struct drm_atomic_commit *state);
1355
1379 struct drm_atomic_commit *state);
1380
1403 struct drm_atomic_commit *state, bool flip);
1404
1440 struct drm_atomic_commit *state);
1441
1463 struct drm_scanout_buffer *sb);
1464
1478 void (*panic_flush)(struct drm_plane *plane);
1479};
1480
1486static inline void drm_plane_helper_add(struct drm_plane *plane,
1487 const struct drm_plane_helper_funcs *funcs)
1488{
1490}
1491
1556
1557#endif
#define bool
Definition stdbool.h:35
int job
Definition main.cpp:51
size_t size_t const struct drm_bridge_funcs * funcs
Definition drm_bridge.h:1300
drm_connector_status
Definition drm_connector.h:67
struct drm_crtc * crtc
Definition drm_crtc.h:1238
struct drm_encoder * encoder
Definition drm_encoder.h:211
drm_mode_status
Definition drm_modes.h:91
struct drm_plane * plane
Definition drm_plane.h:828
int y
Definition layout.c:118
int x
Definition layout.c:118
int64_t ktime_t
Definition kernel.h:404
Definition drm_atomic.h:480
Definition drm_modeset_helper_vtables.h:850
int(* prepare_writeback_job)(struct drm_writeback_connector *connector, struct drm_writeback_job *job)
Definition drm_modeset_helper_vtables.h:1122
int(* get_modes)(struct drm_connector *connector)
Definition drm_modeset_helper_vtables.h:894
void(* cleanup_writeback_job)(struct drm_writeback_connector *connector, struct drm_writeback_job *job)
Definition drm_modeset_helper_vtables.h:1137
enum drm_mode_status(* mode_valid)(struct drm_connector *connector, const struct drm_display_mode *mode)
Definition drm_modeset_helper_vtables.h:958
int(* mode_valid_ctx)(struct drm_connector *connector, const struct drm_display_mode *mode, struct drm_modeset_acquire_ctx *ctx, enum drm_mode_status *status)
Definition drm_modeset_helper_vtables.h:997
void(* atomic_commit)(struct drm_connector *connector, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1105
void(* enable_hpd)(struct drm_connector *connector)
Definition drm_modeset_helper_vtables.h:1154
int(* detect_ctx)(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx, bool force)
Definition drm_modeset_helper_vtables.h:920
void(* disable_hpd)(struct drm_connector *connector)
Definition drm_modeset_helper_vtables.h:1170
int(* atomic_check)(struct drm_connector *connector, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1090
Definition drm_connector.h:1065
Definition drm_connector.h:1998
const struct drm_connector_helper_funcs * helper_private
Definition drm_connector.h:2247
Definition drm_modeset_helper_vtables.h:61
void(* commit)(struct drm_crtc *crtc)
Definition drm_modeset_helper_vtables.h:108
void(* atomic_disable)(struct drm_crtc *crtc, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:421
int(* atomic_check)(struct drm_crtc *crtc, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:334
bool(* get_scanout_position)(struct drm_crtc *crtc, bool in_vblank_irq, int *vpos, int *hpos, ktime_t *stime, ktime_t *etime, const struct drm_display_mode *mode)
Definition drm_modeset_helper_vtables.h:466
int(* mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode, int x, int y, struct drm_framebuffer *old_fb)
Definition drm_modeset_helper_vtables.h:206
void(* dpms)(struct drm_crtc *crtc, int mode)
Definition drm_modeset_helper_vtables.h:78
void(* disable)(struct drm_crtc *crtc)
Definition drm_modeset_helper_vtables.h:282
void(* mode_set_nofb)(struct drm_crtc *crtc)
Definition drm_modeset_helper_vtables.h:229
void(* atomic_begin)(struct drm_crtc *crtc, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:355
bool(* mode_fixup)(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode)
Definition drm_modeset_helper_vtables.h:187
void(* atomic_enable)(struct drm_crtc *crtc, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:401
int(* mode_set_base)(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb)
Definition drm_modeset_helper_vtables.h:248
bool(* handle_vblank_timeout)(struct drm_crtc *crtc)
Definition drm_modeset_helper_vtables.h:481
void(* atomic_flush)(struct drm_crtc *crtc, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:379
enum drm_mode_status(* mode_valid)(struct drm_crtc *crtc, const struct drm_display_mode *mode)
Definition drm_modeset_helper_vtables.h:141
void(* prepare)(struct drm_crtc *crtc)
Definition drm_modeset_helper_vtables.h:93
Definition drm_crtc.h:81
Definition drm_crtc.h:955
const struct drm_crtc_helper_funcs * helper_private
Definition drm_crtc.h:1103
Definition drm_modes.h:252
Definition drm_modeset_helper_vtables.h:501
enum drm_connector_status(* detect)(struct drm_encoder *encoder, struct drm_connector *connector)
Definition drm_modeset_helper_vtables.h:692
void(* atomic_enable)(struct drm_encoder *encoder, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:738
void(* dpms)(struct drm_encoder *encoder, int mode)
Definition drm_modeset_helper_vtables.h:518
bool(* mode_fixup)(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode)
Definition drm_modeset_helper_vtables.h:594
enum drm_mode_status(* mode_valid)(struct drm_encoder *crtc, const struct drm_display_mode *mode)
Definition drm_modeset_helper_vtables.h:551
void(* prepare)(struct drm_encoder *encoder)
Definition drm_modeset_helper_vtables.h:611
void(* commit)(struct drm_encoder *encoder)
Definition drm_modeset_helper_vtables.h:626
int(* atomic_check)(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state)
Definition drm_modeset_helper_vtables.h:828
void(* atomic_mode_set)(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state)
Definition drm_modeset_helper_vtables.h:673
void(* disable)(struct drm_encoder *encoder)
Definition drm_modeset_helper_vtables.h:772
void(* enable)(struct drm_encoder *encoder)
Definition drm_modeset_helper_vtables.h:790
void(* atomic_disable)(struct drm_encoder *encoder, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:715
void(* mode_set)(struct drm_encoder *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode)
Definition drm_modeset_helper_vtables.h:650
Definition drm_encoder.h:106
const struct drm_encoder_helper_funcs * helper_private
Definition drm_encoder.h:197
Definition drm_framebuffer.h:120
Definition drm_modeset_helper_vtables.h:1497
void(* atomic_commit_tail)(struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1533
int(* atomic_commit_setup)(struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1554
Definition drm_modeset_lock.h:46
Definition drm_modeset_helper_vtables.h:1189
int(* get_scanout_buffer)(struct drm_plane *plane, struct drm_scanout_buffer *sb)
Definition drm_modeset_helper_vtables.h:1462
void(* atomic_update)(struct drm_plane *plane, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1328
int(* atomic_async_check)(struct drm_plane *plane, struct drm_atomic_commit *state, bool flip)
Definition drm_modeset_helper_vtables.h:1402
void(* atomic_disable)(struct drm_plane *plane, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1378
void(* end_fb_access)(struct drm_plane *plane, struct drm_plane_state *new_plane_state)
Definition drm_modeset_helper_vtables.h:1274
void(* atomic_async_update)(struct drm_plane *plane, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1439
int(* atomic_check)(struct drm_plane *plane, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1311
void(* atomic_enable)(struct drm_plane *plane, struct drm_atomic_commit *state)
Definition drm_modeset_helper_vtables.h:1353
void(* cleanup_fb)(struct drm_plane *plane, struct drm_plane_state *old_state)
Definition drm_modeset_helper_vtables.h:1243
void(* panic_flush)(struct drm_plane *plane)
Definition drm_modeset_helper_vtables.h:1478
int(* begin_fb_access)(struct drm_plane *plane, struct drm_plane_state *new_plane_state)
Definition drm_modeset_helper_vtables.h:1266
int(* prepare_fb)(struct drm_plane *plane, struct drm_plane_state *new_state)
Definition drm_modeset_helper_vtables.h:1232
Definition drm_plane.h:54
Definition drm_plane.h:641
const struct drm_plane_helper_funcs * helper_private
Definition drm_plane.h:733
Definition drm_panic.h:24
Definition drm_writeback.h:21
Definition drm_writeback.h:92
#define state(x)
#define mode(x)