vsp1_drm.h 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * vsp1_drm.h  --  R-Car VSP1 DRM/KMS Interface
 *
 * Copyright (C) 2015 Renesas Electronics Corporation
 *
 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
 *
 * 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.
 */
#ifndef __VSP1_DRM_H__
#define __VSP1_DRM_H__

16 17
#include <linux/videodev2.h>

18 19
#include "vsp1_pipe.h"

20
/**
21
 * vsp1_drm_pipeline - State for the API exposed to the DRM driver
22
 * @pipe: the VSP1 pipeline used for display
23 24
 * @du_complete: frame completion callback for the DU driver (optional)
 * @du_private: data to be passed to the du_complete callback
25
 */
26
struct vsp1_drm_pipeline {
27
	struct vsp1_pipeline pipe;
28 29

	/* Frame synchronisation */
30
	void (*du_complete)(void *, bool);
31 32 33 34 35 36 37 38 39 40 41 42
	void *du_private;
};

/**
 * vsp1_drm - State for the API exposed to the DRM driver
 * @pipe: the VSP1 DRM pipeline used for display
 * @inputs: source crop rectangle, destination compose rectangle and z-order
 *	position for every input (indexed by RPF index)
 */
struct vsp1_drm {
	struct vsp1_drm_pipeline pipe[VSP1_MAX_LIF];

43 44 45 46 47
	struct {
		struct v4l2_rect crop;
		struct v4l2_rect compose;
		unsigned int zpos;
	} inputs[VSP1_MAX_RPF];
48 49
};

50 51
static inline struct vsp1_drm_pipeline *
to_vsp1_drm_pipeline(struct vsp1_pipeline *pipe)
52
{
53
	return container_of(pipe, struct vsp1_drm_pipeline, pipe);
54 55
}

56
int vsp1_drm_init(struct vsp1_device *vsp1);
57
void vsp1_drm_cleanup(struct vsp1_device *vsp1);
58 59

#endif /* __VSP1_DRM_H__ */