summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
AgeCommit message (Collapse)Author
2022-01-25drm/connector: Fix typo in output formatMaxime Ripard
The HDMI specification mentions YCbCr everywhere, but our enums have YCrCb. Let's rename it to match. Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220120151625.594595-5-maxime@cerno.tech
2019-12-12drm/komeda: Enable new product D32 supportjames qian wang (Arm Technology China)
D32 is simple version of D71, the difference is: - Only has one pipeline - Drop the periph block and merge it to GCU v2: Rebase. v3: Isolate the block counting fix to a new patch Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191210084828.19664-3-james.qian.wang@arm.com
2019-11-14drm/komeda: Adds gamma and color-transform support for DOU-IPSLowry Li (Arm Technology China)
Adds gamma and color-transform support for DOU-IPS. Adds two caps members fgamma_coeffs and ctm_coeffs to komeda_improc_state. If color management changed, set gamma and color-transform accordingly. v5: Rebase with drm-misc-next Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com> Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191112110927.20931-5-james.qian.wang@arm.com
2019-10-21drm/komeda: Dump SC_ENH_* registers from scaler blockMihail Atanassov
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191015105936.50039-1-mihail.atanassov@arm.com
2019-10-16drm/komeda: Adds output-color format supportLowry Li (Arm Technology China)
Sets output color format according to the connector formats and display supported formats. Default value is RGB444 and only force YUV format which must be YUV. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191015091019.26021-1-lowry.li@arm.com
2019-10-16drm/komeda: Set output color depth for outputLowry Li (Arm Technology China)
Set color_depth according to connector->bpc. Changes since v1: - Fixed min_bpc is effectively set but not used in komeda_crtc_get_color_config(). Changes since v2: - Align the code. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191012065030.12691-1-lowry.li@arm.com
2019-10-16drm/komeda: Adds layer horizontal input size limitation check for D71Lowry Li (Arm Technology China)
Adds maximum line size check according to the AFBC decoder limitation and special Line size limitation(2046) for format: YUV420_10BIT and X0L2. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190924080022.19250-3-lowry.li@arm.com
2019-10-16drm/komeda: Add line size supportLowry Li (Arm Technology China)
On D71, we are using the global line size. From D32, every component have a line size register to indicate the fifo size. So this patch is to set line size support and do the line size check. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190924080022.19250-2-lowry.li@arm.com
2019-09-18drm/komeda: Adds register dump support for gcu, lup and douLowry Li (Arm Technology China)
Adds to support register dump on lpu and dou of pipeline and gcu on D71 Changes since v1: - For a constant format without additional arguments, use seq_puts() instead of seq_printf(). Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190917112525.25490-1-lowry.li@arm.com
2019-08-02drm/komeda: Enable dual-link supportjames qian wang (Arm Technology China)
Komeda HW can support dual-link which splits display frame to two halves (left/link0, right/link1) and output them by two output links. Due to the halved pixel rate of each link, the pxlclk of dual-link can be reduced two times compare with single-link. For enabling dual-link: - The DT need to configure two output-links for the pipeline node. - Komeda enable dual-link when both link0 and link1 have been connected. Example of how the pipeline node will look like for dual-link setup pipe0: pipeline@0 { clocks = <&fpgaosc2>; clock-names = "pxclk"; reg = <0>; #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; #address-cells = <1>; #size-cells = <0>; dp0_pipe0_link0: endpoint@0 { reg = <0>; remote-endpoint = <&dlink_connector_in0>; }; dp0_pipe0_link1: endpoint@1 { reg = <1>; remote-endpoint = <&dlink_connector_in1>; }; }; }; Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190618081013.13638-3-james.qian.wang@arm.com
2019-08-02drm/komeda: Use drm_display_mode "crtc_" prefixed hardware timingsjames qian wang (Arm Technology China)
struct drm_display_mode contains two copies of timings. - plain timings. - hardware timings, the ones with "crtc_" prefix. According to the definition, update komeda to use the hardware timing. Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190618081013.13638-2-james.qian.wang@arm.com
2019-06-19drm/komeda: Add new component komeda_splitterjames qian wang (Arm Technology China)
Similar to Layer Split, but Splitter is used for writeback, which splits the compiz result to two half parts and then feed them to two scalers. v2: Rebase Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
2019-06-19drm/komeda: Refine function to_d71_input_idjames qian wang (Arm Technology China)
Since the component_state->input[i] is only valid when it is active, the content of input[i] is undefined if it is inactive. The user must check the state->active_inputs with input index firstly before using state->input[i]. Refine the function to_d71_input_id and directly move such check into it. Simplify the using and avoid problem that caller forget the valid check. Depends on: - https://patchwork.freedesktop.org/series/60856/ Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
2019-06-19drm/komeda: Add split support for scalerjames qian wang (Arm Technology China)
To achieve same caling effect compare with none split, the texel calculation need to use the same scaling ratio before split, so add "total_xxx" to pipeline to describe the hsize/vsize before split. Update pipeline and d71_scaler_update accordingly. v2: Rebase and addressed Liviu's comments Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Add component komeda_mergerjames qian wang (Arm Technology China)
Introduce a new component komeda_merger, because D71 HW supports to split a whole image to two half parts and does the scaling independently. Merger merges two separate results to one, and output it to compositor or wb_layer For this patch: - Add the definition of komeda_merger/merger_state - Report and initialize komeda_merger according to the D71 HW. v2: Rebase Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Rename main engine clk name "mclk" to "aclk"james qian wang (Arm Technology China)
To avoid confusion, unify the driver main engine clk name "mclk" to the spec name "aclk". Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Add format support for Y0L2, P010, YUV420_8/10BITjames qian wang (Arm Technology China)
- Y0L2 and P010 are block (tiled) format, Update the kemeda logic to compatible with such block format. - Since DRM introduced a general block information to drm_format_info, the format_caps->tiled_size no long needed, delete it. - Build some fb utils functions for code sharing. Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Adds SMMU supportLowry Li (Arm Technology China)
Adds iommu_connect and disconnect for SMMU support, and configures TBU translation once SMMU has been attached to the display device. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> [fixed checking of error code returned by dp_wait_cond() and removed extraneous DRM_ERROR() calls] Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Enable color-encoding (YUV format) supportLowry Li (Arm Technology China)
Adds color-encoding properties if layer can support YUV format. Updates HW YUV-RGB matrix state according to the color-encoding properties. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Update HW up-sampling on D71Lowry Li (Arm Technology China)
Updates HW up-sampling method according to the format type. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Clear enable bit in CU_INPUTx_CONTROLLowry Li (Arm Technology China)
Besides clearing the input ID to zero, D71 compiz also has input enable bit in CU_INPUTx_CONTROL which need to be cleared. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Add image enhancement supportjames qian wang (Arm Technology China)
Besides scaling, Arm display scaler also can support image enhancement. For support it, Add a new property "img_enhancement" to plane, then user can turn on/off it by this property, and kernel follow user's requirement to maitain the state and enable/disable the real HW image enhancement. v2: Rebase and rename "needs_img_enhancement" to "en_img_enhancement" Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Add engine clock requirement check for the downscalingjames qian wang (Arm Technology China)
For downscaling there is a restriction, the downscaling needed engine clock can not acceed the real engine clock, and the clock requirement mostly depend on the specific HW, to solve this problem: 1. Add a pipeline func - downscaling_clk_check for CORE to query the real HW if downscaling can be supported. 2. Add new property clock ratio which is the ratio of: (mclk << 32) / pxlclk then User driver can use this ratio to do the clock check to avoid post an invalid downscaling to kernel. v2: Rebase and Delete debug print Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Implement D71 scaler supportjames qian wang (Arm Technology China)
1. Add scaler component and initialize it according to D71 HW. 2. Implement d71_scaler_update/disable/dump v2: - Correct a typo - Constify component_funcs: d71_scaler_funcs Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Added AFBC support for komeda driverjames qian wang (Arm Technology China)
For supporting AFBC: 1. Check if the user requested modifier can be supported by display HW. 2. Check the obj->size with AFBC's requirement. 3. Configure HW according to the modifier (afbc features) This patch depends on: - https://patchwork.freedesktop.org/series/59915/ - https://patchwork.freedesktop.org/series/59000/ v2: Rebase and addressed Ayan's comments Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-19drm/komeda: Add writeback supportjames qian wang (Arm Technology China)
Komeda driver uses a individual component to describe the HW's writeback caps, but drivers doesn't define a new structure and still uses the existing "struct komeda_layer" to describe this new component. The detailed changes as follow: 1. Initialize wb_layer according to HW and report it to CORE. 2. CORE exposes wb_layer as a resource to KMS by private_obj. 3. Report writeback supporting by add a wb_connector to KMS, and then wb_connector will take act as a component resources user, so the func komeda_wb_encoder_atomic_check claims komeda resources (scaler and wb_layer) accroding to its state configuration to the wb_connector. and the wb_state configuration will be validated on the specific component resources to see if the caps of component can meet the requirement of wb_connector. if not check failed. 4. Update irq_handler to notify the completion of writeback. NOTE: This change doesn't add scaling writeback support, that support will be added in the future after the scaler support. v2: Rebase v3: Rebase and constify the d71_wb_layer_funcs v4: Addressed Ayan's comments Depends on: - https://patchwork.freedesktop.org/series/59915/ Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Acked-by: Ayan Kumar Halder <ayan.halder@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-06-03drm/komeda: Constify the usage of komeda_component/pipeline/dev_funcsjames qian wang (Arm Technology China)
Depends on: - https://patchwork.freedesktop.org/series/58976/ - https://patchwork.freedesktop.org/series/59855/ Reported-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-05-07drm/komeda: Mark the local functions as staticjames qian wang (Arm Technology China)
Fix the kbuild test rebot reported warnings: - symbol was not declared. Should it be static? - missing braces around initializer Depends on: - https://patchwork.freedesktop.org/series/58976/ Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-04-01drm/komeda: Add debugfs node "register" for register dumpjames qian wang (Arm Technology China)
Add a debugfs node "register" and entry function dump_register to dev/pipeline/component to register dump, then user can read "/sys/kernel/debug/komeda/register" to get the register values via these chip function. Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> [Added the d71_layer_dump() function that was in a previous commit] Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-04-01drm/komeda: Add D71 improc and timing_ctrlrjames qian wang (Arm Technology China)
Add and initialize improc and timing_ctrlr according to D71 capablitites v2: Rebase. Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-04-01drm/komeda: Add d71 compiz componentjames qian wang (Arm Technology China)
Implement d71_compiz_init and add compiz component to komeda-CORE v2: Rebase. Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-04-01drm/komeda: Add d71 layerjames qian wang (Arm Technology China)
1. Add detailed layer/layer_state definitions 2. Add d71_layer_init to report layer features and capabilities according to D71 layer block. 3. Add d71_layer_updat/disable v2: Rebase. Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> [removed d71_layer_dump() from this commit] Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
2019-03-21drm/komeda: Add d71_enum_resources and d71_cleanupjames qian wang (Arm Technology China)
D71 consists of a number of Register Blocks, every Block controls a specific HW function, every block has a common block_header to represent its type and pipeline information. GCU (Global Control Unit) is the first Block which describe the global information of D71 HW, Like number of block contained and the number of pipeline supported. So the d71_enum_resources parsed GCU and create pipeline according the GCU configuration, and then iterate and detect the blocks that indicated by the GCU and block_header. And this change also added two struct d71_dev/d71_pipeline to extend komeda_dev/komeda_pipeline to add some d71 only members. v2: - Return the specific errno not -1. - Use DRM_DEBUG as default debug msg printer. Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>