1 | /*
|
---|
2 | * Copyright (c) 2021 Jiri Svoboda
|
---|
3 | * Copyright (c) 2013 Jan Vesely
|
---|
4 | * All rights reserved.
|
---|
5 | *
|
---|
6 | * Redistribution and use in source and binary forms, with or without
|
---|
7 | * modification, are permitted provided that the following conditions
|
---|
8 | * are met:
|
---|
9 | *
|
---|
10 | * - Redistributions of source code must retain the above copyright
|
---|
11 | * notice, this list of conditions and the following disclaimer.
|
---|
12 | * - Redistributions in binary form must reproduce the above copyright
|
---|
13 | * notice, this list of conditions and the following disclaimer in the
|
---|
14 | * documentation and/or other materials provided with the distribution.
|
---|
15 | * - The name of the author may not be used to endorse or promote products
|
---|
16 | * derived from this software without specific prior written permission.
|
---|
17 | *
|
---|
18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
28 | */
|
---|
29 |
|
---|
30 | /** @addtogroup amdm37x_dispc
|
---|
31 | * @{
|
---|
32 | */
|
---|
33 | /**
|
---|
34 | * @file
|
---|
35 | */
|
---|
36 |
|
---|
37 | #ifndef AMDM37X_DISPC_H_
|
---|
38 | #define AMDM37X_DISPC_H_
|
---|
39 |
|
---|
40 | #include <abi/fb/visuals.h>
|
---|
41 | #include <ddev_srv.h>
|
---|
42 | #include <ddf/driver.h>
|
---|
43 | #include <gfx/context.h>
|
---|
44 | #include <gfx/coord.h>
|
---|
45 | #include <io/pixel.h>
|
---|
46 | #include <pixconv.h>
|
---|
47 | #include <ddi.h>
|
---|
48 |
|
---|
49 | #include "amdm37x_dispc_regs.h"
|
---|
50 |
|
---|
51 | typedef struct {
|
---|
52 | ddf_fun_t *fun;
|
---|
53 | amdm37x_dispc_regs_t *regs;
|
---|
54 |
|
---|
55 | struct {
|
---|
56 | pixel2visual_t pixel2visual;
|
---|
57 | unsigned width;
|
---|
58 | unsigned height;
|
---|
59 | unsigned pitch;
|
---|
60 | unsigned bpp;
|
---|
61 | } active_fb;
|
---|
62 |
|
---|
63 | pixel_t color;
|
---|
64 | gfx_rect_t rect;
|
---|
65 | gfx_rect_t clip_rect;
|
---|
66 | size_t size;
|
---|
67 | void *fb_data;
|
---|
68 | } amdm37x_dispc_t;
|
---|
69 |
|
---|
70 | typedef struct {
|
---|
71 | /* Containing display controller */
|
---|
72 | amdm37x_dispc_t *dispc;
|
---|
73 | /** Allocation info */
|
---|
74 | gfx_bitmap_alloc_t alloc;
|
---|
75 | /** @c true if we allocated the bitmap, @c false if allocated by caller */
|
---|
76 | bool myalloc;
|
---|
77 | /** Rectangle covered by bitmap */
|
---|
78 | gfx_rect_t rect;
|
---|
79 | /** Bitmap flags */
|
---|
80 | gfx_bitmap_flags_t flags;
|
---|
81 | /** Key color */
|
---|
82 | pixel_t key_color;
|
---|
83 | } amdm37x_bitmap_t;
|
---|
84 |
|
---|
85 | extern ddev_ops_t amdm37x_ddev_ops;
|
---|
86 | extern gfx_context_ops_t amdm37x_gc_ops;
|
---|
87 |
|
---|
88 | extern errno_t amdm37x_dispc_init(amdm37x_dispc_t *, ddf_fun_t *);
|
---|
89 | extern errno_t amdm37x_dispc_fini(amdm37x_dispc_t *);
|
---|
90 |
|
---|
91 | #endif
|
---|
92 | /** @}
|
---|
93 | */
|
---|