2019-06-03 07:44:50 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2018-06-27 15:26:09 -04:00
|
|
|
/*
|
2025-02-14 16:14:34 -08:00
|
|
|
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
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_ENCODER_H__
|
|
|
|
#define __DPU_ENCODER_H__
|
|
|
|
|
|
|
|
#include <drm/drm_crtc.h>
|
|
|
|
#include "dpu_hw_mdss.h"
|
|
|
|
|
|
|
|
#define DPU_ENCODER_FRAME_EVENT_DONE BIT(0)
|
|
|
|
#define DPU_ENCODER_FRAME_EVENT_ERROR BIT(1)
|
|
|
|
#define DPU_ENCODER_FRAME_EVENT_PANEL_DEAD BIT(2)
|
|
|
|
#define DPU_ENCODER_FRAME_EVENT_IDLE BIT(3)
|
|
|
|
|
|
|
|
#define IDLE_TIMEOUT (66 - 16/2)
|
|
|
|
|
2024-10-31 23:44:07 +02:00
|
|
|
#define MAX_H_TILES_PER_DISPLAY 2
|
|
|
|
|
2022-02-17 06:53:53 +03:00
|
|
|
/**
|
|
|
|
* struct msm_display_info - defines display properties
|
2023-04-15 20:19:25 +03:00
|
|
|
* @intf_type: INTF_ type
|
2022-02-17 06:53:53 +03:00
|
|
|
* @num_of_h_tiles: Number of horizontal tiles in case of split interface
|
|
|
|
* @h_tile_instance: Controller instance used per tile. Number of elements is
|
|
|
|
* based on num_of_h_tiles
|
2022-05-07 14:59:42 +03:00
|
|
|
* @is_cmd_mode Boolean to indicate if the CMD mode is requested
|
2024-06-13 20:05:08 +03:00
|
|
|
* @vsync_source: Source of the TE signal for DSI CMD devices
|
2022-02-17 06:53:53 +03:00
|
|
|
*/
|
|
|
|
struct msm_display_info {
|
2023-04-15 20:19:25 +03:00
|
|
|
enum dpu_intf_type intf_type;
|
2022-02-17 06:53:53 +03:00
|
|
|
uint32_t num_of_h_tiles;
|
|
|
|
uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY];
|
2022-05-07 14:59:42 +03:00
|
|
|
bool is_cmd_mode;
|
2024-06-13 20:05:08 +03:00
|
|
|
enum dpu_vsync_source vsync_source;
|
2022-02-17 06:53:53 +03:00
|
|
|
};
|
|
|
|
|
2018-11-16 13:42:29 -05:00
|
|
|
void dpu_encoder_assign_crtc(struct drm_encoder *encoder,
|
|
|
|
struct drm_crtc *crtc);
|
2018-06-27 15:26:09 -04:00
|
|
|
|
2018-11-16 13:42:32 -05:00
|
|
|
void dpu_encoder_toggle_vblank_for_crtc(struct drm_encoder *encoder,
|
|
|
|
struct drm_crtc *crtc, bool enable);
|
|
|
|
|
2019-08-22 21:00:11 -07:00
|
|
|
void dpu_encoder_prepare_for_kickoff(struct drm_encoder *encoder);
|
2018-06-27 15:26:09 -04:00
|
|
|
|
|
|
|
void dpu_encoder_trigger_kickoff_pending(struct drm_encoder *encoder);
|
|
|
|
|
2019-08-29 09:45:09 -07:00
|
|
|
void dpu_encoder_kickoff(struct drm_encoder *encoder);
|
2018-06-27 15:26:09 -04:00
|
|
|
|
2019-08-29 09:45:17 -07:00
|
|
|
int dpu_encoder_vsync_time(struct drm_encoder *drm_enc, ktime_t *wakeup_time);
|
|
|
|
|
2024-02-26 04:28:00 +02:00
|
|
|
int dpu_encoder_wait_for_commit_done(struct drm_encoder *drm_encoder);
|
|
|
|
|
|
|
|
int dpu_encoder_wait_for_tx_complete(struct drm_encoder *drm_encoder);
|
2018-06-27 15:26:09 -04:00
|
|
|
|
|
|
|
enum dpu_intf_mode dpu_encoder_get_intf_mode(struct drm_encoder *encoder);
|
|
|
|
|
2018-11-16 13:42:22 -05:00
|
|
|
void dpu_encoder_virt_runtime_resume(struct drm_encoder *encoder);
|
2018-06-27 15:26:09 -04:00
|
|
|
|
2025-02-14 16:14:37 -08:00
|
|
|
uint32_t dpu_encoder_get_clones(struct drm_encoder *drm_enc);
|
|
|
|
|
2023-06-01 20:22:30 +03:00
|
|
|
struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
|
|
|
|
int drm_enc_mode,
|
2018-06-27 15:26:09 -04:00
|
|
|
struct msm_display_info *disp_info);
|
|
|
|
|
2021-02-18 04:35:46 -08:00
|
|
|
int dpu_encoder_get_linecount(struct drm_encoder *drm_enc);
|
|
|
|
|
2021-08-30 14:13:59 -04:00
|
|
|
int dpu_encoder_get_vsync_count(struct drm_encoder *drm_enc);
|
2018-06-27 15:26:09 -04:00
|
|
|
|
2022-02-25 13:23:11 -08:00
|
|
|
bool dpu_encoder_is_widebus_enabled(const struct drm_encoder *drm_enc);
|
|
|
|
|
2024-01-31 16:47:36 -08:00
|
|
|
bool dpu_encoder_is_dsc_enabled(const struct drm_encoder *drm_enc);
|
|
|
|
|
2022-06-22 10:18:35 -07:00
|
|
|
int dpu_encoder_get_crc_values_cnt(const struct drm_encoder *drm_enc);
|
|
|
|
|
|
|
|
void dpu_encoder_setup_misr(const struct drm_encoder *drm_encoder);
|
|
|
|
|
|
|
|
int dpu_encoder_get_crc(const struct drm_encoder *drm_enc, u32 *crcs, int pos);
|
|
|
|
|
2022-04-06 15:10:25 +05:30
|
|
|
bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc);
|
|
|
|
|
2025-02-14 16:14:25 -08:00
|
|
|
void dpu_encoder_update_topology(struct drm_encoder *drm_enc,
|
|
|
|
struct msm_display_topology *topology,
|
|
|
|
struct drm_atomic_state *state,
|
|
|
|
const struct drm_display_mode *adj_mode);
|
|
|
|
|
|
|
|
bool dpu_encoder_needs_modeset(struct drm_encoder *drm_enc, struct drm_atomic_state *state);
|
|
|
|
|
2022-04-26 07:41:28 -07:00
|
|
|
void dpu_encoder_prepare_wb_job(struct drm_encoder *drm_enc,
|
|
|
|
struct drm_writeback_job *job);
|
|
|
|
|
|
|
|
void dpu_encoder_cleanup_wb_job(struct drm_encoder *drm_enc,
|
|
|
|
struct drm_writeback_job *job);
|
|
|
|
|
2022-04-26 07:41:33 -07:00
|
|
|
bool dpu_encoder_is_valid_for_commit(struct drm_encoder *drm_enc);
|
|
|
|
|
2025-02-14 16:14:34 -08:00
|
|
|
void dpu_encoder_start_frame_done_timer(struct drm_encoder *drm_enc);
|
2018-06-27 15:26:09 -04:00
|
|
|
#endif /* __DPU_ENCODER_H__ */
|