blob: 7f2282c1ded679ae005dee5cf0f69f963ae07713 [file] [log] [blame] [edit]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <assert.h>
#include <ddk/io-buffer.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ddk/device.h>
#include <ddk/io-buffer.h>
#include <ddk/mmio-buffer.h>
#include <ddk/protocol/platform-device.h>
#include <ddk/protocol/display-controller.h>
#include <zircon/listnode.h>
#include <zircon/types.h>
#include <threads.h>
#define DISP_ERROR(fmt, ...) zxlogf(ERROR, "[%s %d]" fmt, __func__, __LINE__, ##__VA_ARGS__)
#define DISP_INFO(fmt, ...) zxlogf(INFO, "[%s %d]" fmt, __func__, __LINE__, ##__VA_ARGS__)
#define DISP_TRACE zxlogf(INFO, "[%s %d]\n", __func__, __LINE__)
typedef struct {
zx_device_t* zxdev;
zx_device_t* parent;
pdev_protocol_t pdev;
zx_handle_t bti;
thrd_t main_thread;
// Lock for general display state, in particular display_id.
mtx_t display_lock;
// Lock for imported images.
mtx_t image_lock;
mmio_buffer_t mmio_dc;
io_buffer_t fbuffer;
display_controller_cb_t* dc_cb;
void* dc_cb_ctx;
list_node_t imported_images;
} imx8m_display_t;