Add CRC support to DPU, which is currently not supported by this driver. Only supports CRC for CRTC for now, but will extend support to other blocks later on. Changes in v2: - Added kfree() calls for return paths in dpu_crtc_get_crc() - Propogated error code for dpu_crtc_get_crc() - Renamed skip_count - Removed dpu_crtc_is_valid_crc_source() - Removed wait for commit in dpu_crtc_set_crc_source() - Moved crc_source from struct dpu_crtc to struct dpu_crtc_state - Moved CRC register constants from dpu_hw_util.h to dpu_hw_lm.c Validated with IGT kms_pipe_crc_basic, and kms_cursor_crc Test: kms_pipe_crc_basic Subtests Passed: - bad-source - read-crc-pipe-A - read-crc-pipe-A-frame-sequence - nonblocking-crc-pipe-A - nonblocking-crc-pipe-A-frame-sequence - disable-crc-after-crtc-pipe-A[1] - compare-crc-sanitycheck-pipe-A[1] Rest skipped Test: kms_cursor_crc Subtests Passed: - pipe-A-cursor-size-change - pipe-A-cursor-alpha-opaque - pipe-A-cursor-alpha-transparent Subtests Failed: - pipe-A-cursor-dpms - pipe-A-cursor-*-onscreen - pipe-A-cursor-*-offscreen Rest skipped Tested on Qualcomm RB3 (debian, sdm845), Qualcomm RB5 (debian, qrb5165) Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Jessica Zhang <jesszhan@codeaurora.org> [1] Skipped on RB5 due to issue related to DPMS. Planning to upload a fix for this in the future. Link: https://lore.kernel.org/r/20211019224822.25940-1-jesszhan@codeaurora.org Signed-off-by: Rob Clark <robdclark@chromium.org>
113 lines
2.6 KiB
C
113 lines
2.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _DPU_HW_LM_H
|
|
#define _DPU_HW_LM_H
|
|
|
|
#include "dpu_hw_mdss.h"
|
|
#include "dpu_hw_util.h"
|
|
#include "dpu_hw_blk.h"
|
|
|
|
struct dpu_hw_mixer;
|
|
|
|
struct dpu_hw_mixer_cfg {
|
|
u32 out_width;
|
|
u32 out_height;
|
|
bool right_mixer;
|
|
int flags;
|
|
};
|
|
|
|
struct dpu_hw_color3_cfg {
|
|
u8 keep_fg[DPU_STAGE_MAX];
|
|
};
|
|
|
|
/**
|
|
*
|
|
* struct dpu_hw_lm_ops : Interface to the mixer Hw driver functions
|
|
* Assumption is these functions will be called after clocks are enabled
|
|
*/
|
|
struct dpu_hw_lm_ops {
|
|
/*
|
|
* Sets up mixer output width and height
|
|
* and border color if enabled
|
|
*/
|
|
void (*setup_mixer_out)(struct dpu_hw_mixer *ctx,
|
|
struct dpu_hw_mixer_cfg *cfg);
|
|
|
|
/*
|
|
* Alpha blending configuration
|
|
* for the specified stage
|
|
*/
|
|
void (*setup_blend_config)(struct dpu_hw_mixer *ctx, uint32_t stage,
|
|
uint32_t fg_alpha, uint32_t bg_alpha, uint32_t blend_op);
|
|
|
|
/*
|
|
* Alpha color component selection from either fg or bg
|
|
*/
|
|
void (*setup_alpha_out)(struct dpu_hw_mixer *ctx, uint32_t mixer_op);
|
|
|
|
/**
|
|
* setup_border_color : enable/disable border color
|
|
*/
|
|
void (*setup_border_color)(struct dpu_hw_mixer *ctx,
|
|
struct dpu_mdss_color *color,
|
|
u8 border_en);
|
|
|
|
/**
|
|
* setup_misr: Enable/disable MISR
|
|
*/
|
|
void (*setup_misr)(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count);
|
|
|
|
/**
|
|
* collect_misr: Read MISR signature
|
|
*/
|
|
int (*collect_misr)(struct dpu_hw_mixer *ctx, u32 *misr_value);
|
|
};
|
|
|
|
struct dpu_hw_mixer {
|
|
struct dpu_hw_blk base;
|
|
struct dpu_hw_blk_reg_map hw;
|
|
|
|
/* lm */
|
|
enum dpu_lm idx;
|
|
const struct dpu_lm_cfg *cap;
|
|
const struct dpu_mdp_cfg *mdp;
|
|
const struct dpu_ctl_cfg *ctl;
|
|
|
|
/* ops */
|
|
struct dpu_hw_lm_ops ops;
|
|
|
|
/* store mixer info specific to display */
|
|
struct dpu_hw_mixer_cfg cfg;
|
|
};
|
|
|
|
/**
|
|
* to_dpu_hw_mixer - convert base object dpu_hw_base to container
|
|
* @hw: Pointer to base hardware block
|
|
* return: Pointer to hardware block container
|
|
*/
|
|
static inline struct dpu_hw_mixer *to_dpu_hw_mixer(struct dpu_hw_blk *hw)
|
|
{
|
|
return container_of(hw, struct dpu_hw_mixer, base);
|
|
}
|
|
|
|
/**
|
|
* dpu_hw_lm_init(): Initializes the mixer hw driver object.
|
|
* should be called once before accessing every mixer.
|
|
* @idx: mixer index for which driver object is required
|
|
* @addr: mapped register io address of MDP
|
|
* @m : pointer to mdss catalog data
|
|
*/
|
|
struct dpu_hw_mixer *dpu_hw_lm_init(enum dpu_lm idx,
|
|
void __iomem *addr,
|
|
const struct dpu_mdss_cfg *m);
|
|
|
|
/**
|
|
* dpu_hw_lm_destroy(): Destroys layer mixer driver context
|
|
* @lm: Pointer to LM driver context
|
|
*/
|
|
void dpu_hw_lm_destroy(struct dpu_hw_mixer *lm);
|
|
|
|
#endif /*_DPU_HW_LM_H */
|