blob: 78a84a45559e39069b9e4090318f46dfd77e203c [file] [log] [blame]
Ao Xu6747bbd2020-09-28 20:02:09 +08001/*
2 * Copyright (C) 2020 Amlogic, Inc. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#include "meson_drm_util.h"
11
12struct drm_display *drm_kms_init(void);
13
14struct drm_display *drm_display_init(void)
15{
16 return drm_kms_init();
17}
18
19void drm_destroy_display(struct drm_display *disp)
20{
21 disp->destroy_display(disp);
22}
23
24void drm_display_register_done_cb(struct drm_display *disp, void *func, void *priv)
25{
26 disp->display_done_callback = func;
27 disp->priv = priv;
28}
29
30void drm_display_register_res_cb(struct drm_display *disp, void *func, void *priv)
31{
32 disp->resolution_change_callback = func;
33 disp->reso_priv = priv;
34}
35
36int drm_alloc_bufs(struct drm_display *disp, int num, struct drm_buf_metadata *info)
37{
38 int ret;
39 ret = disp->alloc_bufs(disp, num, info);
40
41 return ret;
42}
43
44int drm_free_bufs(struct drm_display *disp)
45{
46 int ret;
47 ret = disp->free_bufs(disp);
48
49 return ret;
50}
51
52struct drm_buf *drm_alloc_buf(struct drm_display *disp, struct drm_buf_metadata *info)
53{
54 struct drm_buf *buf = NULL;
55
56 buf = disp->alloc_buf(disp, info);
57
58 return buf;
59}
60
Ao Xu70554242020-10-15 15:19:48 +080061struct drm_buf *drm_import_buf(struct drm_display *disp, struct drm_buf_import *info)
62{
63 struct drm_buf *buf = NULL;
64
65 buf = disp->import_buf(disp, info);
66
67 return buf;
68}
69
Ao Xu6747bbd2020-09-28 20:02:09 +080070int drm_free_buf(struct drm_buf *buf)
71{
72 int ret;
73 struct drm_display *disp = buf->disp;
74 ret = disp->free_buf(buf);
75
76 return ret;
77}
78
79int drm_post_buf(struct drm_display *disp, struct drm_buf *buf)
80{
81 return disp->post_buf(disp, buf);
82}