1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
8 #include <drm/drm_fourcc.h>
10 #include "dpu_hw_mdss.h"
13 * dpu_get_dpu_format_ext() - Returns dpu format structure pointer.
14 * @format: DRM FourCC Code
15 * @modifiers: format modifier array from client, one per plane
17 const struct dpu_format
*dpu_get_dpu_format_ext(
18 const uint32_t format
,
19 const uint64_t modifier
);
21 #define dpu_get_dpu_format(f) dpu_get_dpu_format_ext(f, 0)
24 * dpu_get_msm_format - get an dpu_format by its msm_format base
25 * callback function registers with the msm_kms layer
27 * @format: DRM FourCC Code
28 * @modifiers: data layout modifier
30 const struct msm_format
*dpu_get_msm_format(
32 const uint32_t format
,
33 const uint64_t modifiers
);
36 * dpu_format_check_modified_format - validate format and buffers for
37 * dpu non-standard, i.e. modified format
39 * @msm_fmt: pointer to the msm_fmt base pointer of an dpu_format
40 * @cmd: fb_cmd2 structure user request
41 * @bos: gem buffer object list
43 * Return: error code on failure, 0 on success
45 int dpu_format_check_modified_format(
46 const struct msm_kms
*kms
,
47 const struct msm_format
*msm_fmt
,
48 const struct drm_mode_fb_cmd2
*cmd
,
49 struct drm_gem_object
**bos
);
52 * dpu_format_populate_layout - populate the given format layout based on
53 * mmu, fb, and format found in the fb
54 * @aspace: address space pointer
55 * @fb: framebuffer pointer
56 * @fmtl: format layout structure to populate
58 * Return: error code on failure, -EAGAIN if success but the addresses
59 * are the same as before or 0 if new addresses were populated
61 int dpu_format_populate_layout(
62 struct msm_gem_address_space
*aspace
,
63 struct drm_framebuffer
*fb
,
64 struct dpu_hw_fmt_layout
*fmtl
);
66 #endif /*_DPU_FORMATS_H */