97 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.4 * Copyright (C) 2013 Red Hat5 * Author: Rob Clark <robdclark@gmail.com>6 */7 8#ifndef _DPU_PLANE_H_9#define _DPU_PLANE_H_10 11#include <drm/drm_crtc.h>12 13#include "dpu_kms.h"14#include "dpu_hw_mdss.h"15#include "dpu_hw_sspp.h"16 17/**18 * struct dpu_plane_state: Define dpu extension of drm plane state object19 * @base: base drm plane state object20 * @aspace: pointer to address space for input/output buffers21 * @pipe: software pipe description22 * @r_pipe: software pipe description of the second pipe23 * @pipe_cfg: software pipe configuration24 * @r_pipe_cfg: software pipe configuration for the second pipe25 * @stage: assigned by crtc blender26 * @needs_qos_remap: qos remap settings need to be updated27 * @multirect_index: index of the rectangle of SSPP28 * @multirect_mode: parallel or time multiplex multirect mode29 * @pending: whether the current update is still pending30 * @plane_fetch_bw: calculated BW per plane31 * @plane_clk: calculated clk per plane32 * @needs_dirtyfb: whether attached CRTC needs pixel data explicitly flushed33 * @rotation: simplified drm rotation hint34 */35struct dpu_plane_state {36 struct drm_plane_state base;37 struct msm_gem_address_space *aspace;38 struct dpu_sw_pipe pipe;39 struct dpu_sw_pipe r_pipe;40 struct dpu_sw_pipe_cfg pipe_cfg;41 struct dpu_sw_pipe_cfg r_pipe_cfg;42 enum dpu_stage stage;43 bool needs_qos_remap;44 bool pending;45 46 u64 plane_fetch_bw;47 u64 plane_clk;48 49 bool needs_dirtyfb;50 unsigned int rotation;51};52 53#define to_dpu_plane_state(x) \54 container_of(x, struct dpu_plane_state, base)55 56/**57 * dpu_plane_flush - final plane operations before commit flush58 * @plane: Pointer to drm plane structure59 */60void dpu_plane_flush(struct drm_plane *plane);61 62/**63 * dpu_plane_set_error: enable/disable error condition64 * @plane: pointer to drm_plane structure65 */66void dpu_plane_set_error(struct drm_plane *plane, bool error);67 68/**69 * dpu_plane_init - create new dpu plane for the given pipe70 * @dev: Pointer to DRM device71 * @pipe: dpu hardware pipe identifier72 * @type: Plane type - PRIMARY/OVERLAY/CURSOR73 * @possible_crtcs: bitmask of crtc that can be attached to the given pipe74 *75 */76struct drm_plane *dpu_plane_init(struct drm_device *dev,77 uint32_t pipe, enum drm_plane_type type,78 unsigned long possible_crtcs);79 80/**81 * dpu_plane_color_fill - enables color fill on plane82 * @plane: Pointer to DRM plane object83 * @color: RGB fill color value, [23..16] Blue, [15..8] Green, [7..0] Red84 * @alpha: 8-bit fill alpha value, 255 selects 100% alpha85 * Returns: 0 on success86 */87int dpu_plane_color_fill(struct drm_plane *plane,88 uint32_t color, uint32_t alpha);89 90#ifdef CONFIG_DEBUG_FS91void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable);92#else93static inline void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable) {}94#endif95 96#endif /* _DPU_PLANE_H_ */97