1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
/* SPDX-License-Identifier: GPL-2.0-only
* evdi_cursor.h
*
* Copyright (c) 2016 The Chromium OS Authors
* Copyright (c) 2016 - 2020 DisplayLink (UK) Ltd.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _EVDI_CURSOR_H_
#define _EVDI_CURSOR_H_
#include <linux/version.h>
#include <linux/module.h>
#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8)
#else
#include <drm/drmP.h>
#endif
#include <drm/drm_crtc.h>
struct evdi_cursor;
struct evdi_framebuffer;
struct evdi_gem_object;
int evdi_cursor_init(struct evdi_cursor **cursor);
void evdi_cursor_free(struct evdi_cursor *cursor);
void evdi_cursor_lock(struct evdi_cursor *cursor);
void evdi_cursor_unlock(struct evdi_cursor *cursor);
bool evdi_cursor_enabled(struct evdi_cursor *cursor);
void evdi_cursor_enable(struct evdi_cursor *cursor, bool enabled);
void evdi_cursor_set(struct evdi_cursor *cursor,
struct evdi_gem_object *obj,
uint32_t width, uint32_t height,
int32_t hot_x, int32_t hot_y,
uint32_t pixel_format, uint32_t stride);
void evdi_cursor_move(struct evdi_cursor *cursor, int32_t x, int32_t y);
void evdi_cursor_position(struct evdi_cursor *cursor, int32_t *x, int32_t *y);
void evdi_cursor_hotpoint(struct evdi_cursor *cursor,
int32_t *hot_x, int32_t *hot_y);
void evdi_cursor_size(struct evdi_cursor *cursor,
uint32_t *width, uint32_t *height);
void evdi_cursor_format(struct evdi_cursor *cursor, uint32_t *format);
void evdi_cursor_stride(struct evdi_cursor *cursor, uint32_t *stride);
struct evdi_gem_object *evdi_cursor_gem(struct evdi_cursor *cursor);
int evdi_cursor_compose_and_copy(struct evdi_cursor *cursor,
struct evdi_framebuffer *efb,
char __user *buffer,
int buf_byte_stride);
#endif
|