Loading config/lahainadisp.conf +1 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,4 @@ export CONFIG_DRM_MSM_REGISTER_LOGGING=y export CONFIG_QCOM_MDSS_PLL=y export CONFIG_DRM_SDE_RSC=y export CONFIG_DISPLAY_BUILD=y export CONFIG_DRM_SDE_VM=y config/lahainadispconf.h +1 −1 Original line number Diff line number Diff line Loading @@ -15,4 +15,4 @@ #define CONFIG_DRM_SDE_EVTLOG_DEBUG 1 #define CONFIG_QCOM_MDSS_PLL 1 #define CONFIG_DRM_SDE_RSC 1 #define CONFIG_DRM_SDE_VM 1 msm/Makefile +5 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,11 @@ msm_drm-$(CONFIG_DRM_MSM_SDE) += sde/sde_crtc.o \ sde/sde_hw_qdss.o \ sde_dsc_helper.o \ sde_vdc_helper.o \ sde/sde_hw_rc.o sde/sde_hw_rc.o \ msm_drm-$(CONFIG_DRM_SDE_VM) += sde/sde_vm_common.o \ sde/sde_vm_primary.o \ sde/sde_vm_trusted.o msm_drm-$(CONFIG_DEBUG_FS) += sde_dbg.o \ sde_dbg_evtlog.o \ Loading msm/sde/sde_connector.c +34 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "dsi_display.h" #include "sde_crtc.h" #include "sde_rm.h" #include "sde_vm.h" #include <drm/drm_probe_helper.h> #define BL_NODE_NAME_SIZE 32 Loading Loading @@ -79,6 +80,8 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) int bl_lvl; struct drm_event event; int rc = 0; struct msm_drm_private *priv; struct sde_kms *sde_kms; brightness = bd->props.brightness; Loading @@ -88,6 +91,10 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) brightness = 0; c_conn = bl_get_data(bd); priv = c_conn->base.dev->dev_private; sde_kms = to_sde_kms(priv->kms); display = (struct dsi_display *) c_conn->display; if (brightness > display->panel->bl_config.bl_max_level) brightness = display->panel->bl_config.bl_max_level; Loading @@ -106,6 +113,19 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) return 0; } if (sde_kms->vm) { struct sde_vm_ops *vm_ops = &sde_kms->vm->vm_ops; mutex_lock(&sde_kms->vm->vm_res_lock); if (vm_ops->vm_owns_hw && vm_ops->vm_owns_hw(sde_kms)) { SDE_DEBUG( "skipping bl update due to HW unavailablity\n"); mutex_unlock(&sde_kms->vm->vm_res_lock); return 0; } } if (c_conn->ops.set_backlight) { /* skip notifying user space if bl is 0 */ if (brightness != 0) { Loading @@ -119,6 +139,9 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) c_conn->unset_bl_level = 0; } if (sde_kms->vm) mutex_unlock(&sde_kms->vm->vm_res_lock); return rc; } Loading Loading @@ -152,16 +175,26 @@ static int sde_backlight_setup(struct sde_connector *c_conn, struct backlight_properties props; struct dsi_display *display; struct dsi_backlight_config *bl_config; struct msm_drm_private *priv; struct sde_kms *sde_kms; static int display_count; char bl_node_name[BL_NODE_NAME_SIZE]; if (!c_conn || !dev || !dev->dev) { if (!c_conn || !dev || !dev->dev || !dev->dev_private) { SDE_ERROR("invalid param\n"); return -EINVAL; } else if (c_conn->connector_type != DRM_MODE_CONNECTOR_DSI) { return 0; } priv = dev->dev_private; if (!priv->kms) return -EINVAL; sde_kms = to_sde_kms(priv->kms); if (sde_in_trusted_vm(sde_kms)) return 0; memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW; props.power = FB_BLANK_UNBLANK; Loading msm/sde/sde_hw_top.c +49 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include "sde_dbg.h" #include "sde_kms.h" #define SCRATCH_REGISTER_0 0x14 #define SSPP_SPARE 0x28 #define UBWC_DEC_HW_VERSION 0x058 #define UBWC_STATIC 0x144 Loading Loading @@ -614,6 +615,51 @@ static u32 sde_hw_get_autorefresh_status(struct sde_hw_mdp *mdp, u32 intf_idx) return autorefresh_status; } static void sde_hw_clear_mode_index(struct sde_hw_mdp *mdp) { struct sde_hw_blk_reg_map c; if (!mdp) return; c = mdp->hw; c.blk_off = 0x0; SDE_REG_WRITE(&c, SCRATCH_REGISTER_0, 0x0); } static void sde_hw_set_mode_index(struct sde_hw_mdp *mdp, u32 display_id, u32 mode) { struct sde_hw_blk_reg_map c; u32 value = 0; if (!mdp) return; c = mdp->hw; c.blk_off = 0x0; /* 4-bits for mode index of each display */ value = SDE_REG_READ(&c, SCRATCH_REGISTER_0); value |= (mode << (display_id * 4)); SDE_REG_WRITE(&c, SCRATCH_REGISTER_0, value); } static u32 sde_hw_get_mode_index(struct sde_hw_mdp *mdp, u32 display_id) { struct sde_hw_blk_reg_map c; u32 value = 0; c = mdp->hw; c.blk_off = 0x0; value = SDE_REG_READ(&c, SCRATCH_REGISTER_0); value = (value >> (display_id * 4)) & 0xF; return value; } static void _setup_mdp_ops(struct sde_hw_mdp_ops *ops, unsigned long cap) { Loading @@ -631,6 +677,9 @@ static void _setup_mdp_ops(struct sde_hw_mdp_ops *ops, ops->reset_ubwc = sde_hw_reset_ubwc; ops->intf_audio_select = sde_hw_intf_audio_select; ops->set_mdp_hw_events = sde_hw_mdp_events; ops->set_mode_index = sde_hw_set_mode_index; ops->get_mode_index = sde_hw_get_mode_index; ops->clear_mode_index = sde_hw_clear_mode_index; if (cap & BIT(SDE_MDP_VSYNC_SEL)) ops->setup_vsync_source = sde_hw_setup_vsync_source; else Loading Loading
config/lahainadisp.conf +1 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,4 @@ export CONFIG_DRM_MSM_REGISTER_LOGGING=y export CONFIG_QCOM_MDSS_PLL=y export CONFIG_DRM_SDE_RSC=y export CONFIG_DISPLAY_BUILD=y export CONFIG_DRM_SDE_VM=y
config/lahainadispconf.h +1 −1 Original line number Diff line number Diff line Loading @@ -15,4 +15,4 @@ #define CONFIG_DRM_SDE_EVTLOG_DEBUG 1 #define CONFIG_QCOM_MDSS_PLL 1 #define CONFIG_DRM_SDE_RSC 1 #define CONFIG_DRM_SDE_VM 1
msm/Makefile +5 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,11 @@ msm_drm-$(CONFIG_DRM_MSM_SDE) += sde/sde_crtc.o \ sde/sde_hw_qdss.o \ sde_dsc_helper.o \ sde_vdc_helper.o \ sde/sde_hw_rc.o sde/sde_hw_rc.o \ msm_drm-$(CONFIG_DRM_SDE_VM) += sde/sde_vm_common.o \ sde/sde_vm_primary.o \ sde/sde_vm_trusted.o msm_drm-$(CONFIG_DEBUG_FS) += sde_dbg.o \ sde_dbg_evtlog.o \ Loading
msm/sde/sde_connector.c +34 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include "dsi_display.h" #include "sde_crtc.h" #include "sde_rm.h" #include "sde_vm.h" #include <drm/drm_probe_helper.h> #define BL_NODE_NAME_SIZE 32 Loading Loading @@ -79,6 +80,8 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) int bl_lvl; struct drm_event event; int rc = 0; struct msm_drm_private *priv; struct sde_kms *sde_kms; brightness = bd->props.brightness; Loading @@ -88,6 +91,10 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) brightness = 0; c_conn = bl_get_data(bd); priv = c_conn->base.dev->dev_private; sde_kms = to_sde_kms(priv->kms); display = (struct dsi_display *) c_conn->display; if (brightness > display->panel->bl_config.bl_max_level) brightness = display->panel->bl_config.bl_max_level; Loading @@ -106,6 +113,19 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) return 0; } if (sde_kms->vm) { struct sde_vm_ops *vm_ops = &sde_kms->vm->vm_ops; mutex_lock(&sde_kms->vm->vm_res_lock); if (vm_ops->vm_owns_hw && vm_ops->vm_owns_hw(sde_kms)) { SDE_DEBUG( "skipping bl update due to HW unavailablity\n"); mutex_unlock(&sde_kms->vm->vm_res_lock); return 0; } } if (c_conn->ops.set_backlight) { /* skip notifying user space if bl is 0 */ if (brightness != 0) { Loading @@ -119,6 +139,9 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) c_conn->unset_bl_level = 0; } if (sde_kms->vm) mutex_unlock(&sde_kms->vm->vm_res_lock); return rc; } Loading Loading @@ -152,16 +175,26 @@ static int sde_backlight_setup(struct sde_connector *c_conn, struct backlight_properties props; struct dsi_display *display; struct dsi_backlight_config *bl_config; struct msm_drm_private *priv; struct sde_kms *sde_kms; static int display_count; char bl_node_name[BL_NODE_NAME_SIZE]; if (!c_conn || !dev || !dev->dev) { if (!c_conn || !dev || !dev->dev || !dev->dev_private) { SDE_ERROR("invalid param\n"); return -EINVAL; } else if (c_conn->connector_type != DRM_MODE_CONNECTOR_DSI) { return 0; } priv = dev->dev_private; if (!priv->kms) return -EINVAL; sde_kms = to_sde_kms(priv->kms); if (sde_in_trusted_vm(sde_kms)) return 0; memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW; props.power = FB_BLANK_UNBLANK; Loading
msm/sde/sde_hw_top.c +49 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include "sde_dbg.h" #include "sde_kms.h" #define SCRATCH_REGISTER_0 0x14 #define SSPP_SPARE 0x28 #define UBWC_DEC_HW_VERSION 0x058 #define UBWC_STATIC 0x144 Loading Loading @@ -614,6 +615,51 @@ static u32 sde_hw_get_autorefresh_status(struct sde_hw_mdp *mdp, u32 intf_idx) return autorefresh_status; } static void sde_hw_clear_mode_index(struct sde_hw_mdp *mdp) { struct sde_hw_blk_reg_map c; if (!mdp) return; c = mdp->hw; c.blk_off = 0x0; SDE_REG_WRITE(&c, SCRATCH_REGISTER_0, 0x0); } static void sde_hw_set_mode_index(struct sde_hw_mdp *mdp, u32 display_id, u32 mode) { struct sde_hw_blk_reg_map c; u32 value = 0; if (!mdp) return; c = mdp->hw; c.blk_off = 0x0; /* 4-bits for mode index of each display */ value = SDE_REG_READ(&c, SCRATCH_REGISTER_0); value |= (mode << (display_id * 4)); SDE_REG_WRITE(&c, SCRATCH_REGISTER_0, value); } static u32 sde_hw_get_mode_index(struct sde_hw_mdp *mdp, u32 display_id) { struct sde_hw_blk_reg_map c; u32 value = 0; c = mdp->hw; c.blk_off = 0x0; value = SDE_REG_READ(&c, SCRATCH_REGISTER_0); value = (value >> (display_id * 4)) & 0xF; return value; } static void _setup_mdp_ops(struct sde_hw_mdp_ops *ops, unsigned long cap) { Loading @@ -631,6 +677,9 @@ static void _setup_mdp_ops(struct sde_hw_mdp_ops *ops, ops->reset_ubwc = sde_hw_reset_ubwc; ops->intf_audio_select = sde_hw_intf_audio_select; ops->set_mdp_hw_events = sde_hw_mdp_events; ops->set_mode_index = sde_hw_set_mode_index; ops->get_mode_index = sde_hw_get_mode_index; ops->clear_mode_index = sde_hw_clear_mode_index; if (cap & BIT(SDE_MDP_VSYNC_SEL)) ops->setup_vsync_source = sde_hw_setup_vsync_source; else Loading