Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2016 Red Hat
0004  * Author: Rob Clark <robdclark@gmail.com>
0005  */
0006 
0007 #ifndef __MDP5_PIPE_H__
0008 #define __MDP5_PIPE_H__
0009 
0010 /* TODO: Add SSPP_MAX in mdp5.xml.h */
0011 #define SSPP_MAX    (SSPP_CURSOR1 + 1)
0012 
0013 /* represents a hw pipe, which is dynamically assigned to a plane */
0014 struct mdp5_hw_pipe {
0015     int idx;
0016 
0017     const char *name;
0018     enum mdp5_pipe pipe;
0019 
0020     uint32_t reg_offset;
0021     uint32_t caps;
0022 
0023     uint32_t flush_mask;      /* used to commit pipe registers */
0024 
0025     /* number of smp blocks per plane, ie:
0026      *   nblks_y | (nblks_u << 8) | (nblks_v << 16)
0027      */
0028     uint32_t blkcfg;
0029 };
0030 
0031 /* global atomic state of assignment between pipes and planes: */
0032 struct mdp5_hw_pipe_state {
0033     struct drm_plane *hwpipe_to_plane[SSPP_MAX];
0034 };
0035 
0036 int mdp5_pipe_assign(struct drm_atomic_state *s, struct drm_plane *plane,
0037              uint32_t caps, uint32_t blkcfg,
0038              struct mdp5_hw_pipe **hwpipe,
0039              struct mdp5_hw_pipe **r_hwpipe);
0040 int mdp5_pipe_release(struct drm_atomic_state *s, struct mdp5_hw_pipe *hwpipe);
0041 
0042 struct mdp5_hw_pipe *mdp5_pipe_init(enum mdp5_pipe pipe,
0043         uint32_t reg_offset, uint32_t caps);
0044 void mdp5_pipe_destroy(struct mdp5_hw_pipe *hwpipe);
0045 
0046 #endif /* __MDP5_PIPE_H__ */