diff options
22 files changed, 408 insertions, 130 deletions
diff --git a/Documentation/devicetree/bindings/display/msm/sde.txt b/Documentation/devicetree/bindings/display/msm/sde.txt index 1583da81c090..9472af5de4e7 100644 --- a/Documentation/devicetree/bindings/display/msm/sde.txt +++ b/Documentation/devicetree/bindings/display/msm/sde.txt @@ -247,7 +247,19 @@ Optional properties: applied in scenarios where panel interface can be more tolerant to memory latency such as command mode panels. +- qcom,sde-mixer-display-pref: A string array indicating the preferred display type + for the mixer block. Possible values: + "primary" - preferred for primary display + "secondary" - preferred for secondary display + "tertiary" - preferred for tertiary display + "none" - no preference for display +- qcom,sde-ctl-display-pref: A string array indicating the preferred display type + for the ctl block. Possible values: + "primary" - preferred for primary display + "secondary" - preferred for secondary display + "tertiary" - preferred for tertiary display + "none" - no preference for display Bus Scaling Subnodes: - qcom,sde-reg-bus: Property to provide Bus scaling for register access for mdss blocks. diff --git a/arch/arm/boot/dts/qcom/msm8996-sde.dtsi b/arch/arm/boot/dts/qcom/msm8996-sde.dtsi index 661f0ebfd8fa..ea7c77e4b0a2 100644 --- a/arch/arm/boot/dts/qcom/msm8996-sde.dtsi +++ b/arch/arm/boot/dts/qcom/msm8996-sde.dtsi @@ -59,8 +59,12 @@ qcom,sde-off = <0x1000>; qcom,sde-ctl-off = <0x2000 0x2200 0x2400 0x2600 0x2800>; + qcom,sde-ctl-display-pref = "primary", "secondary", "none", + "none", "none"; qcom,sde-mixer-off = <0x45000 0x46000 0x47000 0x48000 0x49000 0x4a000>; + qcom,sde-mixer-display-pref = "primary", "secondary", "none", + "none", "none"; qcom,sde-dspp-off = <0x55000 0x57000>; qcom,sde-dspp-ad-off = <0x24000 0x22800>; qcom,sde-dspp-ad-version = <0x00030000>; diff --git a/drivers/gpu/drm/msm/sde/sde_color_processing.c b/drivers/gpu/drm/msm/sde/sde_color_processing.c index a0f6b5c6a732..8a086dc68328 100644 --- a/drivers/gpu/drm/msm/sde/sde_color_processing.c +++ b/drivers/gpu/drm/msm/sde/sde_color_processing.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016, 2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by @@ -78,7 +78,7 @@ enum { SDE_CP_CRTC_DSPP_IGC, SDE_CP_CRTC_DSPP_PCC, SDE_CP_CRTC_DSPP_GC, - SDE_CP_CRTC_DSPP_HUE, + SDE_CP_CRTC_DSPP_HSIC, SDE_CP_CRTC_DSPP_SAT, SDE_CP_CRTC_DSPP_VAL, SDE_CP_CRTC_DSPP_CONT, @@ -444,6 +444,7 @@ static void sde_cp_crtc_setfeature(struct sde_cp_node *prop_node, struct sde_hw_cp_cfg hw_cfg; struct sde_hw_mixer *hw_lm; struct sde_hw_dspp *hw_dspp; + struct drm_msm_pa_hsic *hsic_cfg; u32 num_mixers = sde_crtc->num_mixers; int i = 0; bool feature_enabled = false; @@ -484,33 +485,28 @@ static void sde_cp_crtc_setfeature(struct sde_cp_node *prop_node, } hw_dspp->ops.setup_gc(hw_dspp, &hw_cfg); break; - case SDE_CP_CRTC_DSPP_HUE: - if (!hw_dspp || !hw_dspp->ops.setup_hue) { + case SDE_CP_CRTC_DSPP_HSIC: + if (!hw_dspp || !hw_dspp->ops.setup_pa_hsic) { ret = -EINVAL; continue; } - hw_dspp->ops.setup_hue(hw_dspp, &hw_cfg); - break; - case SDE_CP_CRTC_DSPP_SAT: - if (!hw_dspp || !hw_dspp->ops.setup_sat) { - ret = -EINVAL; - continue; - } - hw_dspp->ops.setup_sat(hw_dspp, &hw_cfg); - break; - case SDE_CP_CRTC_DSPP_VAL: - if (!hw_dspp || !hw_dspp->ops.setup_val) { - ret = -EINVAL; - continue; + if (hw_cfg.payload && (hw_cfg.len == + sizeof(struct drm_msm_pa_hsic))) { + /* hw_cfg is valid, check for feature flag */ + hsic_cfg = (struct drm_msm_pa_hsic *) + hw_cfg.payload; + if ((hsic_cfg->flags & + PA_HSIC_LEFT_DISPLAY_ONLY) && (i > 0)) { + /* skip right side programming */ + continue; + } else if ((hsic_cfg->flags & + PA_HSIC_RIGHT_DISPLAY_ONLY) + && (i == 0)) { + /* skip left side programming */ + continue; + } } - hw_dspp->ops.setup_val(hw_dspp, &hw_cfg); - break; - case SDE_CP_CRTC_DSPP_CONT: - if (!hw_dspp || !hw_dspp->ops.setup_cont) { - ret = -EINVAL; - continue; - } - hw_dspp->ops.setup_cont(hw_dspp, &hw_cfg); + hw_dspp->ops.setup_pa_hsic(hw_dspp, &hw_cfg); break; case SDE_CP_CRTC_DSPP_MEMCOLOR: if (!hw_dspp || !hw_dspp->ops.setup_pa_memcolor) @@ -907,9 +903,9 @@ static void dspp_hsic_install_property(struct drm_crtc *crtc) switch (version) { case 1: snprintf(feature_name, ARRAY_SIZE(feature_name), "%s%d", - "SDE_DSPP_HUE_V", version); - sde_cp_crtc_install_range_property(crtc, feature_name, - SDE_CP_CRTC_DSPP_HUE, 0, U32_MAX, 0); + "SDE_DSPP_PA_HSIC_V", version); + sde_cp_crtc_create_blob_property(crtc, feature_name, + SDE_CP_CRTC_DSPP_HSIC); break; default: DRM_ERROR("version %d not supported\n", version); diff --git a/drivers/gpu/drm/msm/sde/sde_connector.h b/drivers/gpu/drm/msm/sde/sde_connector.h index 7db98afad713..6433d3f3bca4 100644 --- a/drivers/gpu/drm/msm/sde/sde_connector.h +++ b/drivers/gpu/drm/msm/sde/sde_connector.h @@ -233,7 +233,7 @@ struct sde_connector { * Returns: Pointer to associated private display structure */ #define sde_connector_get_display(C) \ - ((C) ? to_sde_connector((C))->display : 0) + ((C) ? to_sde_connector((C))->display : NULL) /** * sde_connector_get_panel - get sde connector's private panel pointer @@ -241,7 +241,7 @@ struct sde_connector { * Returns: Pointer to associated private display structure */ #define sde_connector_get_panel(C) \ - ((C) ? to_sde_connector((C))->panel : 0) + ((C) ? to_sde_connector((C))->panel : NULL) /** * sde_connector_get_encoder - get sde connector's private encoder pointer @@ -249,7 +249,7 @@ struct sde_connector { * Returns: Pointer to associated private encoder structure */ #define sde_connector_get_encoder(C) \ - ((C) ? to_sde_connector((C))->encoder : 0) + ((C) ? to_sde_connector((C))->encoder : NULL) /** * sde_connector_get_propinfo - get sde connector's property info pointer @@ -257,7 +257,7 @@ struct sde_connector { * Returns: Pointer to associated private property info structure */ #define sde_connector_get_propinfo(C) \ - ((C) ? &to_sde_connector((C))->property_info : 0) + ((C) ? &to_sde_connector((C))->property_info : NULL) /** * struct sde_connector_state - private connector status structure @@ -300,7 +300,7 @@ struct sde_connector_state { * Returns: Integer value of requested property */ #define sde_connector_get_property_values(S) \ - ((S) ? (to_sde_connector_state((S))->property_values) : 0) + ((S) ? (to_sde_connector_state((S))->property_values) : NULL) /** * sde_connector_get_out_fb - query out_fb value from sde connector state @@ -308,7 +308,7 @@ struct sde_connector_state { * Returns: Output fb associated with specified connector state */ #define sde_connector_get_out_fb(S) \ - ((S) ? to_sde_connector_state((S))->out_fb : 0) + ((S) ? to_sde_connector_state((S))->out_fb : NULL) /** * sde_connector_get_topology_name - helper accessor to retrieve topology_name diff --git a/drivers/gpu/drm/msm/sde/sde_hw_catalog.c b/drivers/gpu/drm/msm/sde/sde_hw_catalog.c index 9e0bf09bff0a..95a25462cadc 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_catalog.c +++ b/drivers/gpu/drm/msm/sde/sde_hw_catalog.c @@ -91,6 +91,7 @@ enum { HW_OFF, HW_LEN, + HW_DISP, HW_PROP_MAX, }; @@ -201,6 +202,7 @@ enum { MIXER_OFF, MIXER_LEN, MIXER_BLOCKS, + MIXER_DISP, MIXER_PROP_MAX, }; @@ -320,12 +322,15 @@ static struct sde_prop_type rgb_prop[] = { static struct sde_prop_type ctl_prop[] = { {HW_OFF, "qcom,sde-ctl-off", true, PROP_TYPE_U32_ARRAY}, {HW_LEN, "qcom,sde-ctl-size", false, PROP_TYPE_U32}, + {HW_DISP, "qcom,sde-ctl-display-pref", false, PROP_TYPE_STRING_ARRAY}, }; static struct sde_prop_type mixer_prop[] = { {MIXER_OFF, "qcom,sde-mixer-off", true, PROP_TYPE_U32_ARRAY}, {MIXER_LEN, "qcom,sde-mixer-size", false, PROP_TYPE_U32}, {MIXER_BLOCKS, "qcom,sde-mixer-blocks", false, PROP_TYPE_NODE}, + {MIXER_DISP, "qcom,sde-mixer-display-pref", false, + PROP_TYPE_STRING_ARRAY}, }; static struct sde_prop_type mixer_blocks_prop[] = { @@ -1102,6 +1107,7 @@ static int sde_ctl_parse_dt(struct device_node *np, goto end; for (i = 0; i < off_count; i++) { + const char *disp_pref = NULL; ctl = sde_cfg->ctl + i; ctl->base = PROP_VALUE_ACCESS(prop_value, HW_OFF, i); ctl->len = PROP_VALUE_ACCESS(prop_value, HW_LEN, 0); @@ -1109,6 +1115,16 @@ static int sde_ctl_parse_dt(struct device_node *np, snprintf(ctl->name, SDE_HW_BLK_NAME_LEN, "ctl_%u", ctl->id - CTL_0); + of_property_read_string_index(np, + ctl_prop[HW_DISP].prop_name, i, &disp_pref); + if (disp_pref) { + if (!strcmp(disp_pref, "primary")) + set_bit(SDE_CTL_PRIMARY_PREF, &ctl->features); + else if (!strcmp(disp_pref, "secondary")) + set_bit(SDE_CTL_SECONDARY_PREF, &ctl->features); + else if (!strcmp(disp_pref, "tertiary")) + set_bit(SDE_CTL_TERTIARY_PREF, &ctl->features); + } if (i < MAX_SPLIT_DISPLAY_CTL) set_bit(SDE_CTL_SPLIT_DISPLAY, &ctl->features); if (i < MAX_PP_SPLIT_DISPLAY_CTL) @@ -1187,6 +1203,7 @@ static int sde_mixer_parse_dt(struct device_node *np, } for (i = 0, pp_idx = 0, dspp_idx = 0; i < off_count; i++) { + const char *disp_pref = NULL; mixer = sde_cfg->mixer + i; sblk = kzalloc(sizeof(*sblk), GFP_KERNEL); if (!sblk) { @@ -1216,6 +1233,21 @@ static int sde_mixer_parse_dt(struct device_node *np, if (sde_cfg->has_src_split) set_bit(SDE_MIXER_SOURCESPLIT, &mixer->features); + of_property_read_string_index(np, + mixer_prop[MIXER_DISP].prop_name, i, &disp_pref); + + if (disp_pref) { + if (!strcmp(disp_pref, "primary")) + set_bit(SDE_DISP_PRIMARY_PREF, + &mixer->features); + else if (!strcmp(disp_pref, "secondary")) + set_bit(SDE_DISP_SECONDARY_PREF, + &mixer->features); + else if (!strcmp(disp_pref, "tertiary")) + set_bit(SDE_DISP_TERTIARY_PREF, + &mixer->features); + } + if ((i < ROT_LM_OFFSET) || (i >= LINE_LM_OFFSET)) { mixer->pingpong = pp_count > 0 ? pp_idx + PINGPONG_0 : PINGPONG_MAX; diff --git a/drivers/gpu/drm/msm/sde/sde_hw_catalog.h b/drivers/gpu/drm/msm/sde/sde_hw_catalog.h index 81e6bfe6defe..0d09f05bb195 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_catalog.h +++ b/drivers/gpu/drm/msm/sde/sde_hw_catalog.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -119,12 +119,18 @@ enum { * @SDE_MIXER_LAYER Layer mixer layer blend configuration, * @SDE_MIXER_SOURCESPLIT Layer mixer supports source-split configuration * @SDE_MIXER_GC Gamma correction block + * @SDE_DISP_PRIMARY_PREF Primary display prefers this mixer + * @SDE_DISP_SECONDARY_PREF Secondary display prefers this mixer + * @SDE_DISP_TERTIARY_PREF Tertiary display prefers this mixer * @SDE_MIXER_MAX maximum value */ enum { SDE_MIXER_LAYER = 0x1, SDE_MIXER_SOURCESPLIT, SDE_MIXER_GC, + SDE_DISP_PRIMARY_PREF, + SDE_DISP_SECONDARY_PREF, + SDE_DISP_TERTIARY_PREF, SDE_MIXER_MAX }; @@ -180,11 +186,17 @@ enum { * CTL sub-blocks * @SDE_CTL_SPLIT_DISPLAY CTL supports video mode split display * @SDE_CTL_PINGPONG_SPLIT CTL supports pingpong split + * @SDE_CTL_PRIMARY_PREF Primary display perfers this CTL + * @SDE_CTL_SECONDARY_PREF Secondary display perfers this CTL + * @SDE_CTL_TERTIARY_PREF Tertiary display perfers this CTL * @SDE_CTL_MAX */ enum { SDE_CTL_SPLIT_DISPLAY = 0x1, SDE_CTL_PINGPONG_SPLIT, + SDE_CTL_PRIMARY_PREF, + SDE_CTL_SECONDARY_PREF, + SDE_CTL_TERTIARY_PREF, SDE_CTL_MAX }; diff --git a/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.c b/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.c index f1f66f37ba6a..6a8d9e0cf2e3 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.c +++ b/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016,2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -256,6 +256,47 @@ void sde_setup_pipe_pa_cont_v1_7(struct sde_hw_pipe *ctx, void *cfg) __setup_pa_cont(&ctx->hw, &ctx->cap->sblk->hsic_blk, contrast, SSPP); } +void sde_setup_dspp_pa_hsic_v1_7(struct sde_hw_dspp *ctx, void *cfg) +{ + struct sde_hw_cp_cfg *hw_cfg = cfg; + struct drm_msm_pa_hsic *hsic_cfg; + u32 hue = 0; + u32 sat = 0; + u32 val = 0; + u32 cont = 0; + + if (!ctx || !cfg) { + DRM_ERROR("invalid param ctx %pK cfg %pK\n", ctx, cfg); + return; + } + + if (hw_cfg->payload && + (hw_cfg->len != sizeof(struct drm_msm_pa_hsic))) { + DRM_ERROR("invalid size of payload len %d exp %zd\n", + hw_cfg->len, sizeof(struct drm_msm_pa_hsic)); + return; + } + + if (!hw_cfg->payload) { + DRM_DEBUG_DRIVER("disable pa hsic feature\n"); + } else { + hsic_cfg = hw_cfg->payload; + if (hsic_cfg->flags & PA_HSIC_HUE_ENABLE) + hue = hsic_cfg->hue; + if (hsic_cfg->flags & PA_HSIC_SAT_ENABLE) + sat = hsic_cfg->saturation; + if (hsic_cfg->flags & PA_HSIC_VAL_ENABLE) + val = hsic_cfg->value; + if (hsic_cfg->flags & PA_HSIC_CONT_ENABLE) + cont = hsic_cfg->contrast; + } + + __setup_pa_hue(&ctx->hw, &ctx->cap->sblk->hsic, hue, DSPP); + __setup_pa_sat(&ctx->hw, &ctx->cap->sblk->hsic, sat, DSPP); + __setup_pa_val(&ctx->hw, &ctx->cap->sblk->hsic, val, DSPP); + __setup_pa_cont(&ctx->hw, &ctx->cap->sblk->hsic, cont, DSPP); +} + void sde_setup_pipe_pa_memcol_v1_7(struct sde_hw_pipe *ctx, enum sde_memcolor_type type, void *cfg) diff --git a/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.h b/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.h index 0f9bc0e38322..185f6b548b65 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.h +++ b/drivers/gpu/drm/msm/sde/sde_hw_color_processing_v1_7.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016,2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -45,6 +45,13 @@ void sde_setup_pipe_pa_val_v1_7(struct sde_hw_pipe *ctx, void *cfg); void sde_setup_pipe_pa_cont_v1_7(struct sde_hw_pipe *ctx, void *cfg); /** + * sde_setup_dspp_pa_hsic_v1_7 - setup DSPP hsic feature in v1.7 hardware + * @ctx: Pointer to DSPP context + * @cfg: Pointer to hsic data + */ +void sde_setup_dspp_pa_hsic_v1_7(struct sde_hw_dspp *ctx, void *cfg); + +/** * sde_setup_pipe_pa_memcol_v1_7 - setup SSPP memory color in v1.7 hardware * @ctx: Pointer to pipe context * @type: Memory color type (Skin, sky, or foliage) diff --git a/drivers/gpu/drm/msm/sde/sde_hw_dspp.c b/drivers/gpu/drm/msm/sde/sde_hw_dspp.c index 2fd879a0030d..4c5af0666d88 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_dspp.c +++ b/drivers/gpu/drm/msm/sde/sde_hw_dspp.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -78,7 +78,8 @@ static void _setup_dspp_ops(struct sde_hw_dspp *c, unsigned long features) case SDE_DSPP_HSIC: if (c->cap->sblk->hsic.version == (SDE_COLOR_PROCESS_VER(0x1, 0x7))) - c->ops.setup_hue = sde_setup_dspp_pa_hue_v1_7; + c->ops.setup_pa_hsic = + sde_setup_dspp_pa_hsic_v1_7; break; case SDE_DSPP_VLUT: if (c->cap->sblk->vlut.version == diff --git a/drivers/gpu/drm/msm/sde/sde_hw_dspp.h b/drivers/gpu/drm/msm/sde/sde_hw_dspp.h index 6e6ad2f8d0e5..e1e8622dd11f 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_dspp.h +++ b/drivers/gpu/drm/msm/sde/sde_hw_dspp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2016, 2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -92,32 +92,11 @@ struct sde_hw_dspp_ops { void (*setup_dither)(struct sde_hw_dspp *ctx, void *cfg); /** - * setup_hue - setup dspp PA hue + * setup_cont - setup dspp PA hsic * @ctx: Pointer to dspp context * @cfg: Pointer to configuration */ - void (*setup_hue)(struct sde_hw_dspp *ctx, void *cfg); - - /** - * setup_sat - setup dspp PA saturation - * @ctx: Pointer to dspp context - * @cfg: Pointer to configuration - */ - void (*setup_sat)(struct sde_hw_dspp *ctx, void *cfg); - - /** - * setup_val - setup dspp PA value - * @ctx: Pointer to dspp context - * @cfg: Pointer to configuration - */ - void (*setup_val)(struct sde_hw_dspp *ctx, void *cfg); - - /** - * setup_cont - setup dspp PA contrast - * @ctx: Pointer to dspp context - * @cfg: Pointer to configuration - */ - void (*setup_cont)(struct sde_hw_dspp *ctx, void *cfg); + void (*setup_pa_hsic)(struct sde_hw_dspp *dspp, void *cfg); /** * setup_vlut - setup dspp PA VLUT diff --git a/drivers/gpu/drm/msm/sde/sde_kms.c b/drivers/gpu/drm/msm/sde/sde_kms.c index 86a5c23b5258..436f61ffaaa6 100644 --- a/drivers/gpu/drm/msm/sde/sde_kms.c +++ b/drivers/gpu/drm/msm/sde/sde_kms.c @@ -345,7 +345,7 @@ static void sde_kms_prepare_commit(struct msm_kms *kms, if (sde_kms->splash_info.handoff && sde_kms->splash_info.display_splash_enabled) - sde_splash_lk_stop_splash(kms, state); + sde_splash_lk_stop_splash(kms); sde_power_resource_enable(&priv->phandle, sde_kms->core_client, true); diff --git a/drivers/gpu/drm/msm/sde/sde_rm.c b/drivers/gpu/drm/msm/sde/sde_rm.c index 6055dc861c72..446bd6bdff1b 100644 --- a/drivers/gpu/drm/msm/sde/sde_rm.c +++ b/drivers/gpu/drm/msm/sde/sde_rm.c @@ -25,6 +25,8 @@ #include "sde_connector.h" #include "sde_hw_sspp.h" #include "sde_splash.h" +#include "dsi_display.h" +#include "sde_hdmi.h" #define RESERVED_BY_OTHER(h, r) \ ((h)->rsvp && ((h)->rsvp->enc_id != (r)->enc_id)) @@ -41,6 +43,7 @@ * @dspp: Whether the user requires a DSPP * @num_lm: Number of layer mixers needed in the use case * @hw_res: Hardware resources required as reported by the encoders + * @disp_id: Current display ID, lm/ctl may have prefer display */ struct sde_rm_requirements { enum sde_rm_topology_name top_name; @@ -49,6 +52,7 @@ struct sde_rm_requirements { int num_ctl; bool needs_split_display; struct sde_encoder_hw_resources hw_res; + uint32_t disp_id; }; /** @@ -565,7 +569,9 @@ static bool _sde_rm_check_lm_and_get_connected_blks( struct sde_lm_cfg *lm_cfg = (struct sde_lm_cfg *)lm->catalog; struct sde_pingpong_cfg *pp_cfg; struct sde_rm_hw_iter iter; - + unsigned long caps = ((struct sde_lm_cfg *)lm->catalog)->features; + unsigned int preferred_disp_id = 0; + bool preferred_disp_match = false; *dspp = NULL; *pp = NULL; @@ -584,9 +590,21 @@ static bool _sde_rm_check_lm_and_get_connected_blks( } } + /* bypass rest of the checks if preferred display is found */ + if (BIT(SDE_DISP_PRIMARY_PREF) & caps) + preferred_disp_id = 1; + else if (BIT(SDE_DISP_SECONDARY_PREF) & caps) + preferred_disp_id = 2; + else if (BIT(SDE_DISP_TERTIARY_PREF) & caps) + preferred_disp_id = 3; + + if (reqs->disp_id == preferred_disp_id) + preferred_disp_match = true; + /* Matches user requirements? */ - if ((RM_RQ_DSPP(reqs) && lm_cfg->dspp == DSPP_MAX) || - (!RM_RQ_DSPP(reqs) && lm_cfg->dspp != DSPP_MAX)) { + if (!preferred_disp_match && + ((RM_RQ_DSPP(reqs) && lm_cfg->dspp == DSPP_MAX) || + (!RM_RQ_DSPP(reqs) && lm_cfg->dspp != DSPP_MAX))) { SDE_DEBUG("dspp req mismatch lm %d reqdspp %d, lm->dspp %d\n", lm_cfg->id, (bool)(RM_RQ_DSPP(reqs)), lm_cfg->dspp); @@ -769,6 +787,7 @@ static int _sde_rm_reserve_ctls( while (_sde_rm_get_hw_locked(rm, &iter)) { unsigned long caps; bool has_split_display, has_ppsplit; + bool ctl_found = false; if (RESERVED_BY_OTHER(iter.blk, rsvp)) continue; @@ -780,9 +799,28 @@ static int _sde_rm_reserve_ctls( SDE_DEBUG("ctl %d caps 0x%lX\n", iter.blk->id, caps); /* early return when finding the matched ctl id */ - if ((prefer_ctl_id > 0) && (iter.blk->id == prefer_ctl_id)) { - ctls[i] = iter.blk; + if ((prefer_ctl_id > 0) && (iter.blk->id == prefer_ctl_id)) + ctl_found = true; + + switch (reqs->disp_id) { + case 1: + if (BIT(SDE_CTL_PRIMARY_PREF) & caps) + ctl_found = true; + break; + case 2: + if (BIT(SDE_CTL_SECONDARY_PREF) & caps) + ctl_found = true; + break; + case 3: + if (BIT(SDE_CTL_TERTIARY_PREF) & caps) + ctl_found = true; + break; + default: + break; + } + if (ctl_found) { + ctls[i] = iter.blk; if (++i == reqs->num_ctl) break; } @@ -933,6 +971,30 @@ static int _sde_rm_make_next_rsvp( struct sde_rm_requirements *reqs) { int ret; + struct sde_connector *sde_conn = + to_sde_connector(conn_state->connector); + struct dsi_display *dsi; + struct sde_hdmi *hdmi; + const char *display_type; + + if (sde_conn->connector_type == DRM_MODE_CONNECTOR_DSI) { + dsi = (struct dsi_display *)sde_conn->display; + display_type = dsi->display_type; + } else if (sde_conn->connector_type == DRM_MODE_CONNECTOR_HDMIA) { + hdmi = (struct sde_hdmi *)sde_conn->display; + display_type = hdmi->display_type; + } else { + /* virtual display does not have display type */ + display_type = "none"; + } + if (!strcmp("primary", display_type)) + reqs->disp_id = 1; + else if (!strcmp("secondary", display_type)) + reqs->disp_id = 2; + else if (!strcmp("tertiary", display_type)) + reqs->disp_id = 3; + else /* No display type set in dtsi */ + reqs->disp_id = 0; /* Create reservation info, tag reserved blocks with it as we go */ rsvp->seq = ++rm->rsvp_next_seq; diff --git a/drivers/gpu/drm/msm/sde/sde_splash.c b/drivers/gpu/drm/msm/sde/sde_splash.c index 9c3964e99c1f..f7e302ecc412 100644 --- a/drivers/gpu/drm/msm/sde/sde_splash.c +++ b/drivers/gpu/drm/msm/sde/sde_splash.c @@ -275,6 +275,25 @@ static void _sde_splash_destroy_splash_node(struct sde_splash_info *sinfo) sinfo->splash_mem_size = NULL; } +static void _sde_splash_update_display_splash_status(struct sde_kms *sde_kms) +{ + struct dsi_display *dsi_display; + struct sde_hdmi *sde_hdmi; + int i = 0; + + for (i = 0; i < sde_kms->dsi_display_count; i++) { + dsi_display = (struct dsi_display *)sde_kms->dsi_displays[i]; + + dsi_display->cont_splash_enabled = false; + } + + for (i = 0; i < sde_kms->hdmi_display_count; i++) { + sde_hdmi = (struct sde_hdmi *)sde_kms->hdmi_displays[i]; + + sde_hdmi->cont_splash_enabled = false; + } +} + static void _sde_splash_sent_pipe_update_uevent(struct sde_kms *sde_kms) { char *event_string; @@ -348,29 +367,6 @@ static int _sde_splash_free_module_resource(struct msm_mmu *mmu, return 0; } -static bool _sde_splash_validate_commit(struct sde_kms *sde_kms, - struct drm_atomic_state *state) -{ - int i, nplanes; - struct drm_plane *plane; - struct drm_device *dev = sde_kms->dev; - - nplanes = dev->mode_config.num_total_plane; - - for (i = 0; i < nplanes; i++) { - plane = state->planes[i]; - - /* - * As plane state has been swapped, we need to check - * fb in state->planes, not fb in state->plane_state. - */ - if (plane && plane->fb) - return true; - } - - return false; -} - __ref int sde_splash_init(struct sde_power_handle *phandle, struct msm_kms *kms) { struct sde_kms *sde_kms; @@ -737,6 +733,7 @@ bool sde_splash_get_lk_complete_status(struct msm_kms *kms) intr = sde_kms->hw_intr; if (sde_kms->splash_info.handoff && + !sde_kms->splash_info.display_splash_enabled && SDE_LK_EXIT_VALUE == SDE_REG_READ(&intr->hw, SCRATCH_REGISTER_1)) { SDE_DEBUG("LK totoally exits\n"); @@ -816,6 +813,9 @@ int sde_splash_free_resource(struct msm_kms *kms, /* send uevent to notify user to recycle resource */ _sde_splash_sent_pipe_update_uevent(sde_kms); + /* set display's splash status to false after handoff is done */ + _sde_splash_update_display_splash_status(sde_kms); + /* Finally mark handoff flag to false to say * handoff is complete. */ @@ -860,8 +860,7 @@ int sde_splash_free_resource(struct msm_kms *kms, * 1. Notify LK to stop display splash. * 2. Set DOMAIN_ATTR_EARLY_MAP to 1 to enable stage 1 translation in iommu. */ -int sde_splash_lk_stop_splash(struct msm_kms *kms, - struct drm_atomic_state *state) +int sde_splash_lk_stop_splash(struct msm_kms *kms) { struct sde_splash_info *sinfo; struct msm_mmu *mmu; @@ -877,8 +876,7 @@ int sde_splash_lk_stop_splash(struct msm_kms *kms, /* Monitor LK's status and tell it to exit. */ mutex_lock(&sde_splash_lock); - if (_sde_splash_validate_commit(sde_kms, state) && - sinfo->display_splash_enabled) { + if (sinfo->display_splash_enabled) { if (_sde_splash_lk_check(sde_kms->hw_intr)) _sde_splash_notify_lk_stop_splash(sde_kms->hw_intr); diff --git a/drivers/gpu/drm/msm/sde/sde_splash.h b/drivers/gpu/drm/msm/sde/sde_splash.h index c4bb7b08f817..d9d2cac1cb5d 100644 --- a/drivers/gpu/drm/msm/sde/sde_splash.h +++ b/drivers/gpu/drm/msm/sde/sde_splash.h @@ -120,8 +120,7 @@ void sde_splash_setup_connector_count(struct sde_splash_info *sinfo, * * Tell LK to stop display splash once one valid user commit arrives. */ -int sde_splash_lk_stop_splash(struct msm_kms *kms, - struct drm_atomic_state *state); +int sde_splash_lk_stop_splash(struct msm_kms *kms); /** * sde_splash_free_resource. diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c b/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c index a2381557070d..6640e414a798 100644 --- a/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c +++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_debug.c @@ -1150,8 +1150,10 @@ static ssize_t sde_rotator_debug_base_reg_read(struct file *file, goto debug_read_error; } - if (dbg->off % sizeof(u32)) - return -EFAULT; + if (dbg->off % sizeof(u32)) { + rc = -EFAULT; + goto debug_read_error; + } ptr = dbg->base + dbg->off; tot = 0; diff --git a/drivers/net/wireless/cnss2/main.c b/drivers/net/wireless/cnss2/main.c index fc35b0892768..5183f3de7c9b 100644 --- a/drivers/net/wireless/cnss2/main.c +++ b/drivers/net/wireless/cnss2/main.c @@ -1890,7 +1890,7 @@ static int cnss_init_dump_entry(struct cnss_plat_data *plat_priv) return msm_dump_data_register(MSM_DUMP_TABLE_APPS, &dump_entry); } -static int cnss_qca6174_register_ramdump(struct cnss_plat_data *plat_priv) +static int cnss_register_ramdump_v1(struct cnss_plat_data *plat_priv) { int ret = 0; struct device *dev; @@ -1941,7 +1941,7 @@ out: return ret; } -static void cnss_qca6174_unregister_ramdump(struct cnss_plat_data *plat_priv) +static void cnss_unregister_ramdump_v1(struct cnss_plat_data *plat_priv) { struct device *dev; struct cnss_ramdump_info *ramdump_info; @@ -1958,7 +1958,7 @@ static void cnss_qca6174_unregister_ramdump(struct cnss_plat_data *plat_priv) ramdump_info->ramdump_pa); } -static int cnss_qca6290_register_ramdump(struct cnss_plat_data *plat_priv) +static int cnss_register_ramdump_v2(struct cnss_plat_data *plat_priv) { int ret = 0; struct cnss_subsys_info *subsys_info; @@ -2014,7 +2014,7 @@ free_ramdump: return ret; } -static void cnss_qca6290_unregister_ramdump(struct cnss_plat_data *plat_priv) +static void cnss_unregister_ramdump_v2(struct cnss_plat_data *plat_priv) { struct cnss_ramdump_info_v2 *info_v2; @@ -2034,11 +2034,11 @@ int cnss_register_ramdump(struct cnss_plat_data *plat_priv) switch (plat_priv->device_id) { case QCA6174_DEVICE_ID: - ret = cnss_qca6174_register_ramdump(plat_priv); + ret = cnss_register_ramdump_v1(plat_priv); break; case QCA6290_EMULATION_DEVICE_ID: case QCA6290_DEVICE_ID: - ret = cnss_qca6290_register_ramdump(plat_priv); + ret = cnss_register_ramdump_v2(plat_priv); break; default: cnss_pr_err("Unknown device ID: 0x%lx\n", plat_priv->device_id); @@ -2052,11 +2052,11 @@ void cnss_unregister_ramdump(struct cnss_plat_data *plat_priv) { switch (plat_priv->device_id) { case QCA6174_DEVICE_ID: - cnss_qca6174_unregister_ramdump(plat_priv); + cnss_unregister_ramdump_v1(plat_priv); break; case QCA6290_EMULATION_DEVICE_ID: case QCA6290_DEVICE_ID: - cnss_qca6290_unregister_ramdump(plat_priv); + cnss_unregister_ramdump_v2(plat_priv); break; default: cnss_pr_err("Unknown device ID: 0x%lx\n", plat_priv->device_id); diff --git a/drivers/regulator/cpr3-hmss-regulator.c b/drivers/regulator/cpr3-hmss-regulator.c index 21381d1ad7fa..1aface23668e 100644 --- a/drivers/regulator/cpr3-hmss-regulator.c +++ b/drivers/regulator/cpr3-hmss-regulator.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1665,20 +1665,29 @@ static int cpr3_hmss_init_controller(struct cpr3_controller *ctrl) return 0; } -static int cpr3_hmss_regulator_suspend(struct platform_device *pdev, - pm_message_t state) +#if CONFIG_PM +static int cpr3_hmss_regulator_suspend(struct device *dev) { - struct cpr3_controller *ctrl = platform_get_drvdata(pdev); + struct cpr3_controller *ctrl = dev_get_drvdata(dev); return cpr3_regulator_suspend(ctrl); } -static int cpr3_hmss_regulator_resume(struct platform_device *pdev) +static int cpr3_hmss_regulator_resume(struct device *dev) { - struct cpr3_controller *ctrl = platform_get_drvdata(pdev); + struct cpr3_controller *ctrl = dev_get_drvdata(dev); return cpr3_regulator_resume(ctrl); } +#else +#define cpr3_hmss_regulator_suspend NULL +#define cpr3_hmss_regulator_resume NULL +#endif + +static const struct dev_pm_ops cpr3_hmss_regulator_pm_ops = { + .suspend = cpr3_hmss_regulator_suspend, + .resume = cpr3_hmss_regulator_resume, +}; /* Data corresponds to the SoC revision */ static const struct of_device_id cpr_regulator_match_table[] = { @@ -1811,11 +1820,10 @@ static struct platform_driver cpr3_hmss_regulator_driver = { .name = "qcom,cpr3-hmss-regulator", .of_match_table = cpr_regulator_match_table, .owner = THIS_MODULE, + .pm = &cpr3_hmss_regulator_pm_ops, }, .probe = cpr3_hmss_regulator_probe, .remove = cpr3_hmss_regulator_remove, - .suspend = cpr3_hmss_regulator_suspend, - .resume = cpr3_hmss_regulator_resume, }; static int cpr_regulator_init(void) diff --git a/drivers/regulator/cpr3-mmss-regulator.c b/drivers/regulator/cpr3-mmss-regulator.c index 5a031f503b51..ec14ffe6b4c4 100644 --- a/drivers/regulator/cpr3-mmss-regulator.c +++ b/drivers/regulator/cpr3-mmss-regulator.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1078,20 +1078,29 @@ static int cpr3_mmss_init_controller(struct cpr3_controller *ctrl) return 0; } -static int cpr3_mmss_regulator_suspend(struct platform_device *pdev, - pm_message_t state) +#if CONFIG_PM +static int cpr3_mmss_regulator_suspend(struct device *dev) { - struct cpr3_controller *ctrl = platform_get_drvdata(pdev); + struct cpr3_controller *ctrl = dev_get_drvdata(dev); return cpr3_regulator_suspend(ctrl); } -static int cpr3_mmss_regulator_resume(struct platform_device *pdev) +static int cpr3_mmss_regulator_resume(struct device *dev) { - struct cpr3_controller *ctrl = platform_get_drvdata(pdev); + struct cpr3_controller *ctrl = dev_get_drvdata(dev); return cpr3_regulator_resume(ctrl); } +#else +#define cpr3_mmss_regulator_suspend NULL +#define cpr3_mmss_regulator_resume NULL +#endif + +static const struct dev_pm_ops cpr3_mmss_regulator_pm_ops = { + .suspend = cpr3_mmss_regulator_suspend, + .resume = cpr3_mmss_regulator_resume, +}; /* Data corresponds to the SoC revision */ static const struct of_device_id cpr_regulator_match_table[] = { @@ -1233,11 +1242,10 @@ static struct platform_driver cpr3_mmss_regulator_driver = { .name = "qcom,cpr3-mmss-regulator", .of_match_table = cpr_regulator_match_table, .owner = THIS_MODULE, + .pm = &cpr3_mmss_regulator_pm_ops, }, .probe = cpr3_mmss_regulator_probe, .remove = cpr3_mmss_regulator_remove, - .suspend = cpr3_mmss_regulator_suspend, - .resume = cpr3_mmss_regulator_resume, }; static int cpr_regulator_init(void) diff --git a/drivers/soc/qcom/hab/khab_test.c b/drivers/soc/qcom/hab/khab_test.c index 3773211aeec7..0b71054ad38f 100644 --- a/drivers/soc/qcom/hab/khab_test.c +++ b/drivers/soc/qcom/hab/khab_test.c @@ -40,7 +40,7 @@ static int hab_shmm_throughput_test(void) register int sum; register int *pp, *lastone; - int throughput[3][2] = {0}; + int throughput[3][2] = { {0} }; int latency[6][PERF_TEST_ITERATION]; int ret = 0, tmp, size; diff --git a/drivers/soc/qcom/watchdog_v2.c b/drivers/soc/qcom/watchdog_v2.c index 625030f1f256..3528cb08c78e 100644 --- a/drivers/soc/qcom/watchdog_v2.c +++ b/drivers/soc/qcom/watchdog_v2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -873,8 +873,7 @@ err: } static const struct dev_pm_ops msm_watchdog_dev_pm_ops = { - .suspend_noirq = msm_watchdog_suspend, - .resume_noirq = msm_watchdog_resume, + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(msm_watchdog_suspend, msm_watchdog_resume) }; static struct platform_driver msm_watchdog_driver = { diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 1a2af68ca93d..a31322ed9447 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1259,9 +1259,9 @@ static void purge_configs_funcs(struct gadget_info *gi) cfg = container_of(c, struct config_usb_cfg, c); - list_for_each_entry_safe(f, tmp, &c->functions, list) { + list_for_each_entry_safe_reverse(f, tmp, &c->functions, list) { - list_move_tail(&f->list, &cfg->func_list); + list_move(&f->list, &cfg->func_list); if (f->unbind) { dev_err(&gi->cdev.gadget->dev, "unbind function" " '%s'/%pK\n", f->name, f); diff --git a/include/uapi/drm/msm_drm_pp.h b/include/uapi/drm/msm_drm_pp.h index 9ed3a13953ef..5f5ca0345140 100644 --- a/include/uapi/drm/msm_drm_pp.h +++ b/include/uapi/drm/msm_drm_pp.h @@ -52,6 +52,34 @@ struct drm_msm_pa_vlut { __u32 val[PA_VLUT_SIZE]; }; +#define PA_HSIC_HUE_ENABLE (1 << 0) +#define PA_HSIC_SAT_ENABLE (1 << 1) +#define PA_HSIC_VAL_ENABLE (1 << 2) +#define PA_HSIC_CONT_ENABLE (1 << 3) +#define PA_HSIC_LEFT_DISPLAY_ONLY (1 << 4) +#define PA_HSIC_RIGHT_DISPLAY_ONLY (1 << 5) +/** + * struct drm_msm_pa_hsic - pa hsic feature structure + * @flags: flags for the feature customization, values can be: + * - PA_HSIC_HUE_ENABLE: Enable hue adjustment + * - PA_HSIC_SAT_ENABLE: Enable saturation adjustment + * - PA_HSIC_VAL_ENABLE: Enable value adjustment + * - PA_HSIC_CONT_ENABLE: Enable contrast adjustment + * + * @hue: hue setting + * @saturation: saturation setting + * @value: value setting + * @contrast: contrast setting + */ +#define DRM_MSM_PA_HSIC +struct drm_msm_pa_hsic { + __u64 flags; + __u32 hue; + __u32 saturation; + __u32 value; + __u32 contrast; +}; + /* struct drm_msm_memcol - Memory color feature strucuture. * Skin, sky, foliage features are supported. * @prot_flags: Bit mask for enabling protection feature. @@ -79,4 +107,94 @@ struct drm_msm_memcol { __u32 val_region; }; +#define GAMUT_3D_MODE_17 1 +#define GAMUT_3D_MODE_5 2 +#define GAMUT_3D_MODE_13 3 + +#define GAMUT_3D_MODE17_TBL_SZ 1229 +#define GAMUT_3D_MODE5_TBL_SZ 32 +#define GAMUT_3D_MODE13_TBL_SZ 550 +#define GAMUT_3D_SCALE_OFF_SZ 16 +#define GAMUT_3D_SCALEB_OFF_SZ 12 +#define GAMUT_3D_TBL_NUM 4 +#define GAMUT_3D_SCALE_OFF_TBL_NUM 3 +#define GAMUT_3D_MAP_EN (1 << 0) + +/** + * struct drm_msm_3d_col - 3d gamut color component structure + * @c0: Holds c0 value + * @c2_c1: Holds c2/c1 values + */ +struct drm_msm_3d_col { + __u32 c2_c1; + __u32 c0; +}; +/** + * struct drm_msm_3d_gamut - 3d gamut feature structure + * @flags: flags for the feature values are: + * 0 - no map + * GAMUT_3D_MAP_EN - enable map + * @mode: lut mode can take following values: + * - GAMUT_3D_MODE_17 + * - GAMUT_3D_MODE_5 + * - GAMUT_3D_MODE_13 + * @scale_off: Scale offset table + * @col: Color component tables + */ +struct drm_msm_3d_gamut { + __u64 flags; + __u32 mode; + __u32 scale_off[GAMUT_3D_SCALE_OFF_TBL_NUM][GAMUT_3D_SCALE_OFF_SZ]; + struct drm_msm_3d_col col[GAMUT_3D_TBL_NUM][GAMUT_3D_MODE17_TBL_SZ]; +}; + +#define PGC_TBL_LEN 512 +#define PGC_8B_ROUND (1 << 0) +/** + * struct drm_msm_pgc_lut - pgc lut feature structure + * @flags: flags for the featue values can be: + * - PGC_8B_ROUND + * @c0: color0 component lut + * @c1: color1 component lut + * @c2: color2 component lut + */ +struct drm_msm_pgc_lut { + __u64 flags; + __u32 c0[PGC_TBL_LEN]; + __u32 c1[PGC_TBL_LEN]; + __u32 c2[PGC_TBL_LEN]; +}; + + +#define IGC_TBL_LEN 256 +#define IGC_DITHER_ENABLE (1 << 0) +/** + * struct drm_msm_igc_lut - igc lut feature structure + * @flags: flags for the feature customization, values can be: + * - IGC_DITHER_ENABLE: Enable dither functionality + * @c0: color0 component lut + * @c1: color1 component lut + * @c2: color2 component lut + * @strength: dither strength, considered valid when IGC_DITHER_ENABLE + * is set in flags. Strength value based on source bit width. + */ +struct drm_msm_igc_lut { + __u64 flags; + __u32 c0[IGC_TBL_LEN]; + __u32 c1[IGC_TBL_LEN]; + __u32 c2[IGC_TBL_LEN]; + __u32 strength; +}; + +#define HIST_V_SIZE 256 +/** + * struct drm_msm_hist - histogram feature structure + * @flags: for customizing operations + * @data: histogram data + */ +struct drm_msm_hist { + __u64 flags; + __u32 data[HIST_V_SIZE]; +}; + #endif /* _MSM_DRM_PP_H_ */ |
