blob: a43833d6c3ff6cadee5bcc2dced90a09d873d85b [file] [log] [blame]
Gurchetan Singh2e786ad2016-08-24 18:31:23 -07001/*
2 * Copyright 2016 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifndef CROS_GRALLOC_HELPERS_H
8#define CROS_GRALLOC_HELPERS_H
9
Gurchetan Singhc67f9e42016-11-28 15:25:26 -080010#include "../drv.h"
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070011#include "cros_gralloc_handle.h"
Gurchetan Singhd6b8b032017-05-31 14:31:31 -070012#include "cros_gralloc_types.h"
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070013
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070014#include <system/graphics.h>
Gurchetan Singhd6b8b032017-05-31 14:31:31 -070015#include <system/window.h>
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070016
Gurchetan Singhb7538e22017-03-20 14:45:39 -070017constexpr uint32_t cros_gralloc_magic = 0xABCDDCBA;
Gurchetan Singh989873c2017-05-26 10:04:29 -070018constexpr uint32_t handle_data_size =
19 ((sizeof(struct cros_gralloc_handle) - offsetof(cros_gralloc_handle, fds[0])) / sizeof(int));
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070020
Gurchetan Singhd6b8b032017-05-31 14:31:31 -070021uint32_t cros_gralloc_convert_format(int32_t format);
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070022
Gurchetan Singhd6b8b032017-05-31 14:31:31 -070023cros_gralloc_handle_t cros_gralloc_convert_handle(buffer_handle_t handle);
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070024
Jason Macnak1de7f662020-01-24 15:05:57 -080025int32_t cros_gralloc_sync_wait(int32_t fence, bool close_fence);
Gurchetan Singh4b5d0bf2017-06-22 18:38:37 -070026
Gurchetan Singh2d482e02020-10-05 17:17:13 -070027std::string get_drm_format_string(uint32_t drm_format);
28
Gurchetan Singh2e786ad2016-08-24 18:31:23 -070029#endif