2019-06-03 07:44:50 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2018-06-27 15:26:09 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
|
|
|
|
* Copyright (C) 2013 Red Hat
|
|
|
|
* Author: Rob Clark <robdclark@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DPU_PLANE_H_
|
|
|
|
#define _DPU_PLANE_H_
|
|
|
|
|
|
|
|
#include <drm/drm_crtc.h>
|
|
|
|
|
|
|
|
#include "dpu_kms.h"
|
|
|
|
#include "dpu_hw_mdss.h"
|
|
|
|
#include "dpu_hw_sspp.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct dpu_plane_state: Define dpu extension of drm plane state object
|
|
|
|
* @base: base drm plane state object
|
2023-03-16 19:16:28 +03:00
|
|
|
* @pipe: software pipe description
|
2023-03-16 19:16:48 +03:00
|
|
|
* @r_pipe: software pipe description of the second pipe
|
2023-03-16 19:16:41 +03:00
|
|
|
* @pipe_cfg: software pipe configuration
|
2023-03-16 19:16:48 +03:00
|
|
|
* @r_pipe_cfg: software pipe configuration for the second pipe
|
2018-06-27 15:26:09 -04:00
|
|
|
* @stage: assigned by crtc blender
|
2020-12-01 15:38:55 -08:00
|
|
|
* @needs_qos_remap: qos remap settings need to be updated
|
2018-06-27 15:26:09 -04:00
|
|
|
* @multirect_index: index of the rectangle of SSPP
|
|
|
|
* @multirect_mode: parallel or time multiplex multirect mode
|
|
|
|
* @pending: whether the current update is still pending
|
2020-07-16 17:05:34 +05:30
|
|
|
* @plane_fetch_bw: calculated BW per plane
|
|
|
|
* @plane_clk: calculated clk per plane
|
2022-02-23 11:11:08 -08:00
|
|
|
* @needs_dirtyfb: whether attached CRTC needs pixel data explicitly flushed
|
2024-09-03 06:22:48 +03:00
|
|
|
* @layout: framebuffer memory layout
|
2018-06-27 15:26:09 -04:00
|
|
|
*/
|
|
|
|
struct dpu_plane_state {
|
|
|
|
struct drm_plane_state base;
|
2023-03-16 19:16:28 +03:00
|
|
|
struct dpu_sw_pipe pipe;
|
2023-03-16 19:16:48 +03:00
|
|
|
struct dpu_sw_pipe r_pipe;
|
2023-03-16 19:16:41 +03:00
|
|
|
struct dpu_sw_pipe_cfg pipe_cfg;
|
2023-03-16 19:16:48 +03:00
|
|
|
struct dpu_sw_pipe_cfg r_pipe_cfg;
|
2018-06-27 15:26:09 -04:00
|
|
|
enum dpu_stage stage;
|
2020-12-01 15:38:55 -08:00
|
|
|
bool needs_qos_remap;
|
2018-06-27 15:26:09 -04:00
|
|
|
bool pending;
|
|
|
|
|
2020-07-16 17:05:34 +05:30
|
|
|
u64 plane_fetch_bw;
|
|
|
|
u64 plane_clk;
|
2022-02-23 11:11:08 -08:00
|
|
|
|
|
|
|
bool needs_dirtyfb;
|
2024-09-03 06:22:48 +03:00
|
|
|
|
|
|
|
struct dpu_hw_fmt_layout layout;
|
2018-06-27 15:26:09 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define to_dpu_plane_state(x) \
|
|
|
|
container_of(x, struct dpu_plane_state, base)
|
|
|
|
|
|
|
|
void dpu_plane_flush(struct drm_plane *plane);
|
|
|
|
|
|
|
|
void dpu_plane_set_error(struct drm_plane *plane, bool error);
|
|
|
|
|
|
|
|
struct drm_plane *dpu_plane_init(struct drm_device *dev,
|
2018-08-22 23:19:56 +05:30
|
|
|
uint32_t pipe, enum drm_plane_type type,
|
2022-02-09 20:24:56 +03:00
|
|
|
unsigned long possible_crtcs);
|
2018-06-27 15:26:09 -04:00
|
|
|
|
2024-12-15 14:40:16 +02:00
|
|
|
struct drm_plane *dpu_plane_init_virtual(struct drm_device *dev,
|
|
|
|
enum drm_plane_type type,
|
|
|
|
unsigned long possible_crtcs);
|
|
|
|
|
|
|
|
int dpu_plane_color_fill(struct drm_plane *plane,
|
|
|
|
uint32_t color, uint32_t alpha);
|
|
|
|
|
2021-12-02 01:26:26 +03:00
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
|
|
void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable);
|
|
|
|
#else
|
|
|
|
static inline void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable) {}
|
|
|
|
#endif
|
|
|
|
|
2024-12-15 14:40:16 +02:00
|
|
|
int dpu_assign_plane_resources(struct dpu_global_state *global_state,
|
|
|
|
struct drm_atomic_state *state,
|
|
|
|
struct drm_crtc *crtc,
|
|
|
|
struct drm_plane_state **states,
|
|
|
|
unsigned int num_planes);
|
|
|
|
|
2018-06-27 15:26:09 -04:00
|
|
|
#endif /* _DPU_PLANE_H_ */
|