From 6c3bc3025406b09b7a55a248df44e4bc91d6129e Mon Sep 17 00:00:00 2001 From: Govinda Rajulu Chenna Date: Sun, 18 Feb 2018 23:16:12 -0500 Subject: [PATCH] drm/msm: add drm_connector as input to sde connector ops This change adds drm_connector as one of the input parameter to sde_connector_ops. sde_connector_ops needs drm_connector input when interface drivers are working with more than one stream, similar DP MST. Change-Id: Ic8499482bacd901245ed7051cd8abb338781bc8c Signed-off-by: Govinda Rajulu Chenna --- drivers/gpu/drm/msm/dp/dp_drm.c | 15 ++++--- drivers/gpu/drm/msm/dp/dp_drm.h | 21 ++++++++-- drivers/gpu/drm/msm/dsi-staging/dsi_display.c | 21 ++++++---- drivers/gpu/drm/msm/dsi-staging/dsi_display.h | 37 ++++++++++++++---- drivers/gpu/drm/msm/dsi-staging/dsi_drm.c | 16 ++++---- drivers/gpu/drm/msm/dsi-staging/dsi_drm.h | 9 +++-- drivers/gpu/drm/msm/sde/sde_connector.c | 19 +++++---- drivers/gpu/drm/msm/sde/sde_connector.h | 39 ++++++++++++++----- drivers/gpu/drm/msm/sde/sde_encoder.c | 13 ++++--- drivers/gpu/drm/msm/sde/sde_kms.c | 11 +++--- drivers/gpu/drm/msm/sde/sde_wb.c | 11 ++++-- drivers/gpu/drm/msm/sde/sde_wb.h | 10 +++-- 12 files changed, 151 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 8ef8d87ff7c0..dcf36ca0efd4 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -276,7 +276,7 @@ static const struct drm_bridge_funcs dp_bridge_ops = { .mode_set = dp_bridge_mode_set, }; -int dp_connector_config_hdr(void *display, +int dp_connector_config_hdr(struct drm_connector *connector, void *display, struct sde_connector_state *c_state) { struct dp_display *dp = display; @@ -304,8 +304,10 @@ int dp_connector_post_init(struct drm_connector *connector, void *display) return 0; } -int dp_connector_get_mode_info(const struct drm_display_mode *drm_mode, - struct msm_mode_info *mode_info, u32 max_mixer_width, void *display) +int dp_connector_get_mode_info(struct drm_connector *connector, + const struct drm_display_mode *drm_mode, + struct msm_mode_info *mode_info, + u32 max_mixer_width, void *display) { const u32 dual_lm = 2; const u32 single_lm = 1; @@ -331,7 +333,8 @@ int dp_connector_get_mode_info(const struct drm_display_mode *drm_mode, return 0; } -int dp_connector_get_info(struct msm_display_info *info, void *data) +int dp_connector_get_info(struct drm_connector *connector, + struct msm_display_info *info, void *data) { struct dp_display *display = data; @@ -364,7 +367,7 @@ enum drm_connector_status dp_connector_detect(struct drm_connector *conn, /* get display dp_info */ memset(&info, 0x0, sizeof(info)); - rc = dp_connector_get_info(&info, display); + rc = dp_connector_get_info(conn, &info, display); if (rc) { pr_err("failed to get display info, rc=%d\n", rc); return connector_status_disconnected; @@ -382,7 +385,7 @@ enum drm_connector_status dp_connector_detect(struct drm_connector *conn, return status; } -void dp_connector_post_open(void *display) +void dp_connector_post_open(struct drm_connector *connector, void *display) { struct dp_display *dp; diff --git a/drivers/gpu/drm/msm/dp/dp_drm.h b/drivers/gpu/drm/msm/dp/dp_drm.h index 3ca10c2c9c5c..4c513c3b4433 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.h +++ b/drivers/gpu/drm/msm/dp/dp_drm.h @@ -33,11 +33,13 @@ struct dp_bridge { /** * dp_connector_config_hdr - callback to configure HDR + * @connector: Pointer to drm connector structure * @display: Pointer to private display handle * @c_state: connect state data * Returns: Zero on success */ -int dp_connector_config_hdr(void *display, +int dp_connector_config_hdr(struct drm_connector *connector, + void *display, struct sde_connector_state *c_state); /** @@ -81,23 +83,34 @@ enum drm_mode_status dp_connector_mode_valid(struct drm_connector *connector, /** * dp_connector_get_mode_info - retrieve information of the mode selected + * @connector: Pointer to drm connector structure * @drm_mode: Display mode set for the display * @mode_info: Out parameter. Information of the mode * @max_mixer_width: max width supported by HW layer mixer * @display: Pointer to private display structure * Returns: zero on success */ -int dp_connector_get_mode_info(const struct drm_display_mode *drm_mode, +int dp_connector_get_mode_info(struct drm_connector *connector, + const struct drm_display_mode *drm_mode, struct msm_mode_info *mode_info, u32 max_mixer_width, void *display); -int dp_connector_get_info(struct msm_display_info *info, void *display); +/** + * dp_connector_get_info - retrieve connector display info + * @connector: Pointer to drm connector structure + * @info: Out parameter. Information of the connected display + * @display: Pointer to private display structure + * Returns: zero on success + */ +int dp_connector_get_info(struct drm_connector *connector, + struct msm_display_info *info, void *display); /** * dp_connector_post_open - handle the post open functionalites + * @connector: Pointer to drm connector structure * @display: Pointer to private display structure */ -void dp_connector_post_open(void *display); +void dp_connector_post_open(struct drm_connector *connector, void *display); int dp_drm_bridge_init(void *display, struct drm_encoder *encoder); diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c index 9870df79d740..3812c72bd844 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c @@ -75,7 +75,8 @@ void dsi_rect_intersect(const struct dsi_rect *r1, } } -int dsi_display_set_backlight(void *display, u32 bl_lvl) +int dsi_display_set_backlight(struct drm_connector *connector, + void *display, u32 bl_lvl) { struct dsi_display *dsi_display = display; struct dsi_panel *panel; @@ -520,7 +521,7 @@ static int dsi_display_status_check_te(struct dsi_display *display) return rc; } -int dsi_display_check_status(void *display) +int dsi_display_check_status(struct drm_connector *connector, void *display) { struct dsi_display *dsi_display = display; struct dsi_panel *panel; @@ -605,7 +606,8 @@ static int dsi_display_ctrl_get_host_init_state(struct dsi_display *dsi_display, return rc; } -int dsi_display_cmd_transfer(void *display, const char *cmd_buf, +int dsi_display_cmd_transfer(struct drm_connector *connector, + void *display, const char *cmd_buf, u32 cmd_buf_len) { struct dsi_display *dsi_display = display; @@ -669,7 +671,9 @@ int dsi_display_soft_reset(void *display) return rc; } -enum dsi_pixel_format dsi_display_get_dst_format(void *display) +enum dsi_pixel_format dsi_display_get_dst_format( + struct drm_connector *connector, + void *display) { enum dsi_pixel_format format = DSI_PIXEL_FORMAT_MAX; struct dsi_display *dsi_display = (struct dsi_display *)display; @@ -1340,7 +1344,8 @@ static int dsi_display_phy_idle_off(struct dsi_display *display) return 0; } -void dsi_display_enable_event(struct dsi_display *display, +void dsi_display_enable_event(struct drm_connector *connector, + struct dsi_display *display, uint32_t event_idx, struct dsi_event_cb_info *event_info, bool enable) { @@ -4062,7 +4067,8 @@ int dsi_display_drm_bridge_deinit(struct dsi_display *display) return rc; } -int dsi_display_get_info(struct msm_display_info *info, void *disp) +int dsi_display_get_info(struct drm_connector *connector, + struct msm_display_info *info, void *disp) { struct dsi_display *display; struct dsi_panel_phy_props phy_props; @@ -5085,7 +5091,8 @@ static int dsi_display_set_roi(struct dsi_display *display, return rc; } -int dsi_display_pre_kickoff(struct dsi_display *display, +int dsi_display_pre_kickoff(struct drm_connector *connector, + struct dsi_display *display, struct msm_display_kickoff_params *params) { int rc = 0; diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.h b/drivers/gpu/drm/msm/dsi-staging/dsi_display.h index 7ddbe217217b..242b01017208 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.h +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.h @@ -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 @@ -289,12 +289,14 @@ int dsi_display_drm_bridge_deinit(struct dsi_display *display); /** * dsi_display_get_info() - returns the display properties + * @connector: Pointer to drm connector structure * @info: Pointer to the structure where info is stored. * @disp: Handle to the display. * * Return: error code. */ -int dsi_display_get_info(struct msm_display_info *info, void *disp); +int dsi_display_get_info(struct drm_connector *connector, + struct msm_display_info *info, void *disp); /** * dsi_display_get_mode_count() - get number of modes supported by the display @@ -519,30 +521,44 @@ int dsi_dispaly_static_frame(struct dsi_display *display, bool enable); /** * dsi_display_enable_event() - enable interrupt based connector event + * @connector: Pointer to drm connector structure * @display: Handle to display. * @event_idx: Event index. * @event_info: Event callback definition. * @enable: Whether to enable/disable the event interrupt. */ -void dsi_display_enable_event(struct dsi_display *display, +void dsi_display_enable_event(struct drm_connector *connector, + struct dsi_display *display, uint32_t event_idx, struct dsi_event_cb_info *event_info, bool enable); -int dsi_display_set_backlight(void *display, u32 bl_lvl); +/** + * dsi_display_set_backlight() - set backlight + * @connector: Pointer to drm connector structure + * @display: Handle to display. + * @bl_lvl: Backlight level. + * @event_info: Event callback definition. + * @enable: Whether to enable/disable the event interrupt. + */ +int dsi_display_set_backlight(struct drm_connector *connector, + void *display, u32 bl_lvl); /** * dsi_display_check_status() - check if panel is dead or alive + * @connector: Pointer to drm connector structure * @display: Handle to display. */ -int dsi_display_check_status(void *display); +int dsi_display_check_status(struct drm_connector *connector, void *display); /** * dsi_display_cmd_transfer() - transfer command to the panel + * @connector: Pointer to drm connector structure * @display: Handle to display. * @cmd_buf: Command buffer * @cmd_buf_len: Command buffer length in bytes */ -int dsi_display_cmd_transfer(void *display, const char *cmd_buffer, +int dsi_display_cmd_transfer(struct drm_connector *connector, + void *display, const char *cmd_buffer, u32 cmd_buf_len); /** @@ -578,18 +594,23 @@ int dsi_display_set_power(struct drm_connector *connector, /* * dsi_display_pre_kickoff - program kickoff-time features + * @connector: Pointer to drm connector structure * @display: Pointer to private display structure * @params: Parameters for kickoff-time programming * Returns: Zero on success */ -int dsi_display_pre_kickoff(struct dsi_display *display, +int dsi_display_pre_kickoff(struct drm_connector *connector, + struct dsi_display *display, struct msm_display_kickoff_params *params); /** * dsi_display_get_dst_format() - get dst_format from DSI display + * @connector: Pointer to drm connector structure * @display: Handle to display * * Return: enum dsi_pixel_format type */ -enum dsi_pixel_format dsi_display_get_dst_format(void *display); +enum dsi_pixel_format dsi_display_get_dst_format( + struct drm_connector *connector, + void *display); #endif /* _DSI_DISPLAY_H_ */ diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_drm.c b/drivers/gpu/drm/msm/dsi-staging/dsi_drm.c index dae50ade2735..82d65b25f085 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_drm.c +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_drm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, 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 @@ -332,9 +332,10 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge, return true; } -int dsi_conn_get_mode_info(const struct drm_display_mode *drm_mode, - struct msm_mode_info *mode_info, - u32 max_mixer_width, void *display) +int dsi_conn_get_mode_info(struct drm_connector *connector, + const struct drm_display_mode *drm_mode, + struct msm_mode_info *mode_info, + u32 max_mixer_width, void *display) { struct dsi_display_mode dsi_mode; struct dsi_mode_info *timing; @@ -523,7 +524,7 @@ enum drm_connector_status dsi_conn_detect(struct drm_connector *conn, /* get display dsi_info */ memset(&info, 0x0, sizeof(info)); - rc = dsi_display_get_info(&info, display); + rc = dsi_display_get_info(conn, &info, display); if (rc) { pr_err("failed to get display info, rc=%d\n", rc); return connector_status_disconnected; @@ -640,7 +641,7 @@ int dsi_conn_pre_kickoff(struct drm_connector *connector, return -EINVAL; } - return dsi_display_pre_kickoff(display, params); + return dsi_display_pre_kickoff(connector, display, params); } void dsi_conn_enable_event(struct drm_connector *connector, @@ -653,7 +654,8 @@ void dsi_conn_enable_event(struct drm_connector *connector, event_info.event_cb = sde_connector_trigger_event; event_info.event_usr_ptr = connector; - dsi_display_enable_event(display, event_idx, &event_info, enable); + dsi_display_enable_event(connector, display, + event_idx, &event_info, enable); } int dsi_conn_post_kickoff(struct drm_connector *connector) diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_drm.h b/drivers/gpu/drm/msm/dsi-staging/dsi_drm.h index ec58479d7b4a..7ec55485cfab 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_drm.h +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_drm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, 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 @@ -81,9 +81,10 @@ void dsi_connector_put_modes(struct drm_connector *connector, * @display: Pointer to private display structure * Returns: Zero on success */ -int dsi_conn_get_mode_info(const struct drm_display_mode *drm_mode, - struct msm_mode_info *mode_info, u32 max_mixer_width, - void *display); +int dsi_conn_get_mode_info(struct drm_connector *connector, + const struct drm_display_mode *drm_mode, + struct msm_mode_info *mode_info, u32 max_mixer_width, + void *display); /** * dsi_conn_mode_valid - callback to determine if specified mode is valid diff --git a/drivers/gpu/drm/msm/sde/sde_connector.c b/drivers/gpu/drm/msm/sde/sde_connector.c index 86002524308d..9deb9bb99dfc 100644 --- a/drivers/gpu/drm/msm/sde/sde_connector.c +++ b/drivers/gpu/drm/msm/sde/sde_connector.c @@ -93,7 +93,8 @@ static int sde_backlight_device_update_status(struct backlight_device *bd) event.length = sizeof(u32); msm_mode_object_event_notify(&c_conn->base.base, c_conn->base.dev, &event, (u8 *)&brightness); - c_conn->ops.set_backlight(c_conn->display, bl_lvl); + c_conn->ops.set_backlight(&c_conn->base, + c_conn->display, bl_lvl); } return 0; @@ -242,7 +243,7 @@ static int _sde_connector_get_default_dither_cfg_v1( return 0; } - dst_format = c_conn->ops.get_dst_format(c_conn->display); + dst_format = c_conn->ops.get_dst_format(&c_conn->base, c_conn->display); switch (dst_format) { case DSI_PIXEL_FORMAT_RGB888: dither_cfg->c0_bitdepth = 8; @@ -400,7 +401,7 @@ int sde_connector_get_info(struct drm_connector *connector, return -EINVAL; } - return c_conn->ops.get_info(info, c_conn->display); + return c_conn->ops.get_info(&c_conn->base, info, c_conn->display); } void sde_connector_schedule_status_work(struct drm_connector *connector, @@ -511,7 +512,8 @@ static int _sde_connector_update_bl_scale(struct sde_connector *c_conn) SDE_DEBUG("bl_scale = %u, bl_scale_ad = %u, bl_level = %u\n", bl_config->bl_scale, bl_config->bl_scale_ad, bl_config->bl_level); - rc = c_conn->ops.set_backlight(dsi_display, bl_config->bl_level); + rc = c_conn->ops.set_backlight(&c_conn->base, + dsi_display, bl_config->bl_level); return rc; } @@ -994,7 +996,8 @@ static int _sde_connector_set_ext_hdr_info( } if (c_conn->ops.config_hdr) - rc = c_conn->ops.config_hdr(c_conn->display, c_state); + rc = c_conn->ops.config_hdr(&c_conn->base, + c_conn->display, c_state); end: return rc; } @@ -1454,7 +1457,7 @@ static ssize_t _sde_debugfs_conn_cmd_tx_write(struct file *file, goto end; mutex_lock(&c_conn->lock); - rc = c_conn->ops.cmd_transfer(c_conn->display, buffer, + rc = c_conn->ops.cmd_transfer(&c_conn->base, c_conn->display, buffer, buf_size); c_conn->last_cmd_tx_sts = !rc ? true : false; mutex_unlock(&c_conn->lock); @@ -1657,7 +1660,7 @@ static void sde_connector_check_status_work(struct work_struct *work) return; } - rc = conn->ops.check_status(conn->display); + rc = conn->ops.check_status(&conn->base, conn->display); mutex_unlock(&conn->lock); if (conn->force_panel_dead) { @@ -1720,7 +1723,7 @@ static int sde_connector_populate_mode_info(struct drm_connector *conn, memset(&mode_info, 0, sizeof(mode_info)); - rc = c_conn->ops.get_mode_info(mode, &mode_info, + rc = c_conn->ops.get_mode_info(&c_conn->base, mode, &mode_info, sde_kms->catalog->max_mixer_width, c_conn->display); if (rc) { diff --git a/drivers/gpu/drm/msm/sde/sde_connector.h b/drivers/gpu/drm/msm/sde/sde_connector.h index 9c37869d35bd..65b57093decb 100644 --- a/drivers/gpu/drm/msm/sde/sde_connector.h +++ b/drivers/gpu/drm/msm/sde/sde_connector.h @@ -85,11 +85,13 @@ struct sde_connector_ops { /** * update_pps - update pps command for the display panel + * @connector: Pointer to drm connector structure * @pps_cmd: Pointer to pps command * @display: Pointer to private display handle * Returns: Zero on success */ - int (*update_pps)(char *pps_cmd, void *display); + int (*update_pps)(struct drm_connector *connector, + char *pps_cmd, void *display); /** * mode_valid - determine if specified mode is valid @@ -134,21 +136,25 @@ struct sde_connector_ops { /** * get_info - get display information + * @connector: Pointer to drm connector structure * @info: Pointer to msm display info structure * @display: Pointer to private display structure * Returns: Zero on success */ - int (*get_info)(struct msm_display_info *info, void *display); + int (*get_info)(struct drm_connector *connector, + struct msm_display_info *info, void *display); /** * get_mode_info - retrieve mode information + * @connector: Pointer to drm connector structure * @drm_mode: Display mode set for the display * @mode_info: Out parameter. information of the display mode * @max_mixer_width: max width supported by HW layer mixer * @display: Pointer to private display structure * Returns: Zero on success */ - int (*get_mode_info)(const struct drm_display_mode *drm_mode, + int (*get_mode_info)(struct drm_connector *connector, + const struct drm_display_mode *drm_mode, struct msm_mode_info *mode_info, u32 max_mixer_width, void *display); @@ -162,7 +168,14 @@ struct sde_connector_ops { void (*enable_event)(struct drm_connector *connector, uint32_t event_idx, bool enable, void *display); - int (*set_backlight)(void *display, u32 bl_lvl); + /** + * set_backlight - set backlight level + * @connector: Pointer to drm connector structure + * @display: Pointer to private display structure + * @bl_lvel: Backlight level + */ + int (*set_backlight)(struct drm_connector *connector, + void *display, u32 bl_lvl); /** * soft_reset - perform a soft reset on the connector @@ -207,10 +220,12 @@ struct sde_connector_ops { /** * get_dst_format - get dst_format from display + * @connector: Pointer to drm connector structure * @display: Pointer to private display handle * Returns: dst_format of display */ - enum dsi_pixel_format (*get_dst_format)(void *display); + enum dsi_pixel_format (*get_dst_format)(struct drm_connector *connector, + void *display); /** * post_kickoff - display to program post kickoff-time features @@ -223,32 +238,36 @@ struct sde_connector_ops { * post_open - calls connector to process post open functionalities * @display: Pointer to private display structure */ - void (*post_open)(void *display); + void (*post_open)(struct drm_connector *connector, void *display); /** * check_status - check status of connected display panel + * @connector: Pointer to drm connector structure * @display: Pointer to private display handle * Returns: positive value for success, negetive or zero for failure */ - int (*check_status)(void *display); + int (*check_status)(struct drm_connector *connector, void *display); /** * cmd_transfer - Transfer command to the connected display panel + * @connector: Pointer to drm connector structure * @display: Pointer to private display handle * @cmd_buf: Command buffer * @cmd_buf_len: Command buffer length in bytes * Returns: Zero for success, negetive for failure */ - int (*cmd_transfer)(void *display, const char *cmd_buf, + int (*cmd_transfer)(struct drm_connector *connector, + void *display, const char *cmd_buf, u32 cmd_buf_len); /** * config_hdr - configure HDR + * @connector: Pointer to drm connector structure * @display: Pointer to private display handle * @c_state: Pointer to connector state * Returns: Zero on success, negative error code for failures */ - int (*config_hdr)(void *display, + int (*config_hdr)(struct drm_connector *connector, void *display, struct sde_connector_state *c_state); }; @@ -285,6 +304,7 @@ struct sde_connector_evt { * @encoder: Pointer to preferred drm encoder * @panel: Pointer to drm panel, if present * @display: Pointer to private display data structure + * @drv_panel: Pointer to interface driver's panel module, if present * @mmu_secure: MMU id for secure buffers * @mmu_unsecure: MMU id for unsecure buffers * @name: ASCII name of connector @@ -320,6 +340,7 @@ struct sde_connector { struct drm_encoder *encoder; struct drm_panel *panel; void *display; + void *drv_panel; struct msm_gem_address_space *aspace[SDE_IOMMU_DOMAIN_MAX]; diff --git a/drivers/gpu/drm/msm/sde/sde_encoder.c b/drivers/gpu/drm/msm/sde/sde_encoder.c index bb65ee1c21d3..7843eae23514 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder.c @@ -961,7 +961,7 @@ static int sde_encoder_virt_atomic_check( if (!ret && sde_conn && drm_atomic_crtc_needs_modeset(crtc_state)) { struct msm_display_topology *topology = NULL; - ret = sde_conn->ops.get_mode_info(adj_mode, + ret = sde_conn->ops.get_mode_info(&sde_conn->base, adj_mode, &sde_conn_state->mode_info, sde_kms->catalog->max_mixer_width, sde_conn->display); @@ -2511,7 +2511,7 @@ static void sde_encoder_virt_mode_set(struct drm_encoder *drm_enc, sde_conn = to_sde_connector(conn); sde_conn_state = to_sde_connector_state(conn->state); if (sde_conn && sde_conn_state) { - ret = sde_conn->ops.get_mode_info(adj_mode, + ret = sde_conn->ops.get_mode_info(&sde_conn->base, adj_mode, &sde_conn_state->mode_info, sde_kms->catalog->max_mixer_width, sde_conn->display); @@ -4827,10 +4827,11 @@ int sde_encoder_update_caps_for_cont_splash(struct drm_encoder *encoder) return -EINVAL; } - ret = sde_conn->ops.get_mode_info(&encoder->crtc->state->adjusted_mode, - &sde_conn_state->mode_info, - sde_kms->catalog->max_mixer_width, - sde_conn->display); + ret = sde_conn->ops.get_mode_info(&sde_conn->base, + &encoder->crtc->state->adjusted_mode, + &sde_conn_state->mode_info, + sde_kms->catalog->max_mixer_width, + sde_conn->display); if (ret) { SDE_ERROR_ENC(sde_enc, "conn: ->get_mode_info failed. ret=%d\n", ret); diff --git a/drivers/gpu/drm/msm/sde/sde_kms.c b/drivers/gpu/drm/msm/sde/sde_kms.c index 02b3e9a3b12a..280c5ed09330 100644 --- a/drivers/gpu/drm/msm/sde/sde_kms.c +++ b/drivers/gpu/drm/msm/sde/sde_kms.c @@ -977,7 +977,7 @@ static int _sde_kms_setup_displays(struct drm_device *dev, encoder = NULL; memset(&info, 0x0, sizeof(info)); - rc = dsi_display_get_info(&info, display); + rc = dsi_display_get_info(NULL, &info, display); if (rc) { SDE_ERROR("dsi get_info %d failed\n", i); continue; @@ -1019,7 +1019,7 @@ static int _sde_kms_setup_displays(struct drm_device *dev, encoder = NULL; memset(&info, 0x0, sizeof(info)); - rc = sde_wb_get_info(&info, display); + rc = sde_wb_get_info(NULL, &info, display); if (rc) { SDE_ERROR("wb get_info %d failed\n", i); continue; @@ -1060,7 +1060,7 @@ static int _sde_kms_setup_displays(struct drm_device *dev, encoder = NULL; memset(&info, 0x0, sizeof(info)); - rc = dp_connector_get_info(&info, display); + rc = dp_connector_get_info(NULL, &info, display); if (rc) { SDE_ERROR("dp get_info %d failed\n", i); continue; @@ -1888,7 +1888,8 @@ static void _sde_kms_post_open(struct msm_kms *kms, struct drm_file *file) sde_conn = to_sde_connector(connector); if (sde_conn->ops.post_open) - sde_conn->ops.post_open(sde_conn->display); + sde_conn->ops.post_open(&sde_conn->base, + sde_conn->display); } drm_connector_list_iter_end(&conn_iter); mutex_unlock(&dev->mode_config.mutex); @@ -1940,7 +1941,7 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms) SDE_DEBUG("encoder name = %s\n", encoder->name); } memset(&info, 0x0, sizeof(info)); - rc = dsi_display_get_info(&info, display); + rc = dsi_display_get_info(NULL, &info, display); if (rc) { SDE_ERROR("dsi get_info %d failed\n", i); encoder = NULL; diff --git a/drivers/gpu/drm/msm/sde/sde_wb.c b/drivers/gpu/drm/msm/sde/sde_wb.c index c69f6e9367da..788884547c25 100644 --- a/drivers/gpu/drm/msm/sde/sde_wb.c +++ b/drivers/gpu/drm/msm/sde/sde_wb.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 @@ -296,7 +296,8 @@ done: return rc; } -int sde_wb_get_info(struct msm_display_info *info, void *display) +int sde_wb_get_info(struct drm_connector *connector, + struct msm_display_info *info, void *display) { struct sde_wb_device *wb_dev = display; @@ -318,8 +319,10 @@ int sde_wb_get_info(struct msm_display_info *info, void *display) return 0; } -int sde_wb_get_mode_info(const struct drm_display_mode *drm_mode, - struct msm_mode_info *mode_info, u32 max_mixer_width, void *display) +int sde_wb_get_mode_info(struct drm_connector *connector, + const struct drm_display_mode *drm_mode, + struct msm_mode_info *mode_info, + u32 max_mixer_width, void *display) { const u32 dual_lm = 2; const u32 single_lm = 1; diff --git a/drivers/gpu/drm/msm/sde/sde_wb.h b/drivers/gpu/drm/msm/sde/sde_wb.h index d414bd005a46..983037556cb5 100644 --- a/drivers/gpu/drm/msm/sde/sde_wb.h +++ b/drivers/gpu/drm/msm/sde/sde_wb.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 @@ -189,21 +189,25 @@ int sde_wb_connector_set_property(struct drm_connector *connector, /** * sde_wb_get_info - retrieve writeback 'display' information + * @connector: Pointer to drm connector structure * @info: Pointer to display info structure * @display: Pointer to private display structure * Returns: Zero on success */ -int sde_wb_get_info(struct msm_display_info *info, void *display); +int sde_wb_get_info(struct drm_connector *connector, + struct msm_display_info *info, void *display); /** * sde_wb_get_mode_info - retrieve information of the mode selected + * @connector: Pointer to drm connector structure * @drm_mode: Display mode set for the display * @mode_info: Out parameter. information of the mode. * @max_mixer_width: max width supported by HW layer mixer * @display: Pointer to private display structure * Returns: zero on success */ -int sde_wb_get_mode_info(const struct drm_display_mode *drm_mode, +int sde_wb_get_mode_info(struct drm_connector *connector, + const struct drm_display_mode *drm_mode, struct msm_mode_info *mode_info, u32 max_mixer_width, void *display);