disp: msm: use upstream dsc config data

This change enforces dp, dsi and the sde drivers to use the
drm framework defined dsc_config data structure. As a part of this,
it introduces the sde_dsc_helper API to configure the dsc params
and creating a PPS command. Earlier each driver implemented it's
private versions leading to duplication of code. Additionaly the
helper api supports DSC spec 1.2 422 and 420 mode.

Change-Id: I25933fab08cdabbc6787079926885d1a78945e97
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
This commit is contained in:
Abhijit Kulkarni
2019-05-14 10:21:07 -07:00
rodzic 673ebb896c
commit acb8d98e66
14 zmienionych plików z 705 dodań i 930 usunięć

Wyświetl plik

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
*
@@ -45,6 +45,7 @@
#include <drm/msm_drm.h>
#include <drm/sde_drm.h>
#include <drm/drm_gem.h>
#include <drm/drm_dsc.h>
#include "sde_power_handle.h"
@@ -311,114 +312,44 @@ struct msm_roi_caps {
/**
* struct msm_display_dsc_info - defines dsc configuration
* @version: DSC version.
* @config DSC encoder configuration
* @scr_rev: DSC revision.
* @pic_height: Picture height in pixels.
* @pic_width: Picture width in pixels.
* @initial_lines: Number of initial lines stored in encoder.
* @pkt_per_line: Number of packets per line.
* @bytes_in_slice: Number of bytes in slice.
* @eol_byte_num: Valid bytes at the end of line.
* @bytes_per_pkt Number of bytes in DSI packet
* @pclk_per_line: Compressed width.
* @full_frame_slices: Number of slice per interface.
* @slice_height: Slice height in pixels.
* @slice_width: Slice width in pixels.
* @chunk_size: Chunk size in bytes for slice multiplexing.
* @slice_last_group_size: Size of last group in pixels.
* @bpp: Target bits per pixel.
* @bpc: Number of bits per component.
* @line_buf_depth: Line buffer bit depth.
* @block_pred_enable: Block prediction enabled/disabled.
* @vbr_enable: VBR mode.
* @enable_422: Indicates if input uses 4:2:2 sampling.
* @convert_rgb: DSC color space conversion.
* @input_10_bits: 10 bit per component input.
* @slice_per_pkt: Number of slices per packet.
* @initial_dec_delay: Initial decoding delay.
* @initial_xmit_delay: Initial transmission delay.
* @initial_scale_value: Scale factor value at the beginning of a slice.
* @scale_decrement_interval: Scale set up at the beginning of a slice.
* @scale_increment_interval: Scale set up at the end of a slice.
* @first_line_bpg_offset: Extra bits allocated on the first line of a slice.
* @nfl_bpg_offset: Slice specific settings.
* @slice_bpg_offset: Slice specific settings.
* @initial_offset: Initial offset at the start of a slice.
* @final_offset: Maximum end-of-slice value.
* @rc_model_size: Number of bits in RC model.
* @det_thresh_flatness: Flatness threshold.
* @max_qp_flatness: Maximum QP for flatness adjustment.
* @min_qp_flatness: Minimum QP for flatness adjustment.
* @edge_factor: Ratio to detect presence of edge.
* @quant_incr_limit0: QP threshold.
* @quant_incr_limit1: QP threshold.
* @tgt_offset_hi: Upper end of variability range.
* @tgt_offset_lo: Lower end of variability range.
* @buf_thresh: Thresholds in RC model
* @range_min_qp: Min QP allowed.
* @range_max_qp: Max QP allowed.
* @range_bpg_offset: Bits per group adjustment.
* @extra_width: Extra width required in timing calculations.
* @pps_delay_ms: Post PPS command delay in milliseconds.
*/
struct msm_display_dsc_info {
u8 version;
struct drm_dsc_config config;
u8 scr_rev;
int pic_height;
int pic_width;
int slice_height;
int slice_width;
int initial_lines;
int pkt_per_line;
int bytes_in_slice;
int bytes_per_pkt;
int eol_byte_num;
int pclk_per_line;
int full_frame_slices;
int slice_last_group_size;
int bpp;
int bpc;
int line_buf_depth;
int slice_per_pkt;
int chunk_size;
bool block_pred_enable;
int vbr_enable;
int enable_422;
int convert_rgb;
int input_10_bits;
int initial_dec_delay;
int initial_xmit_delay;
int initial_scale_value;
int scale_decrement_interval;
int scale_increment_interval;
int first_line_bpg_offset;
int nfl_bpg_offset;
int slice_bpg_offset;
int initial_offset;
int final_offset;
int rc_model_size;
int det_thresh_flatness;
int max_qp_flatness;
int min_qp_flatness;
int edge_factor;
int quant_incr_limit0;
int quant_incr_limit1;
int tgt_offset_hi;
int tgt_offset_lo;
u32 *buf_thresh;
char *range_min_qp;
char *range_max_qp;
char *range_bpg_offset;
u32 extra_width;
u32 pps_delay_ms;
};
/**
* Bits/pixel target >> 4 (removing the fractional bits)
* returns the integer bpp value from the drm_dsc_config struct
*/
#define DSC_BPP(config) ((config).bits_per_pixel >> 4)
/**
* struct msm_compression_info - defined panel compression
* @comp_type: type of compression supported