The change adds a new mode property allowed_mode_switch. The new property is a 32bit bitmask that indicates the modes each mode can switch to. This change is required to pass the driver mode switching capabilities, so that user mode can reject any mode switch that is not supported by the driver. Change-Id: I76d1733a07a6d57487ba9f461055270d7e60e060 Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
159 lines
5.0 KiB
C
159 lines
5.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _DSI_DRM_H_
|
|
#define _DSI_DRM_H_
|
|
|
|
#include <linux/types.h>
|
|
#include <drm/drmP.h>
|
|
#include <drm/drm_crtc.h>
|
|
|
|
#include "msm_drv.h"
|
|
|
|
#include "dsi_display.h"
|
|
|
|
#define NO_OVERRIDE -1
|
|
|
|
struct dsi_bridge {
|
|
struct drm_bridge base;
|
|
u32 id;
|
|
|
|
struct dsi_display *display;
|
|
struct dsi_display_mode dsi_mode;
|
|
};
|
|
|
|
/**
|
|
* dsi_conn_set_info_blob - callback to perform info blob initialization
|
|
* @connector: Pointer to drm connector structure
|
|
* @info: Pointer to sde connector info structure
|
|
* @display: Pointer to private display handle
|
|
* @mode_info: Pointer to mode info structure
|
|
* Returns: Zero on success
|
|
*/
|
|
int dsi_conn_set_info_blob(struct drm_connector *connector,
|
|
void *info,
|
|
void *display,
|
|
struct msm_mode_info *mode_info);
|
|
|
|
/**
|
|
* dsi_conn_detect - callback to determine if connector is connected
|
|
* @connector: Pointer to drm connector structure
|
|
* @force: Force detect setting from drm framework
|
|
* @display: Pointer to private display handle
|
|
* Returns: Connector 'is connected' status
|
|
*/
|
|
enum drm_connector_status dsi_conn_detect(struct drm_connector *conn,
|
|
bool force,
|
|
void *display);
|
|
|
|
/**
|
|
* dsi_connector_get_modes - callback to add drm modes via drm_mode_probed_add()
|
|
* @connector: Pointer to drm connector structure
|
|
* @display: Pointer to private display handle
|
|
* @avail_res: Pointer with curr available resources
|
|
* Returns: Number of modes added
|
|
*/
|
|
int dsi_connector_get_modes(struct drm_connector *connector,
|
|
void *display, const struct msm_resource_caps_info *avail_res);
|
|
|
|
/**
|
|
* dsi_connector_put_modes - callback to free up drm modes of the connector
|
|
* @connector: Pointer to drm connector structure
|
|
* @display: Pointer to private display handle
|
|
*/
|
|
void dsi_connector_put_modes(struct drm_connector *connector,
|
|
void *display);
|
|
|
|
/**
|
|
* dsi_conn_get_mode_info - retrieve information on the mode selected
|
|
* @drm_mode: Display mode set for the display
|
|
* @mode_info: Out parameter. information of the mode.
|
|
* @display: Pointer to private display structure
|
|
* @avail_res: Pointer with curr available resources
|
|
* Returns: Zero on success
|
|
*/
|
|
int dsi_conn_get_mode_info(struct drm_connector *connector,
|
|
const struct drm_display_mode *drm_mode,
|
|
struct msm_mode_info *mode_info,
|
|
void *display, const struct msm_resource_caps_info *avail_res);
|
|
|
|
/**
|
|
* dsi_conn_mode_valid - callback to determine if specified mode is valid
|
|
* @connector: Pointer to drm connector structure
|
|
* @mode: Pointer to drm mode structure
|
|
* @display: Pointer to private display handle
|
|
* @avail_res: Pointer with curr available resources
|
|
* Returns: Validity status for specified mode
|
|
*/
|
|
enum drm_mode_status dsi_conn_mode_valid(struct drm_connector *connector,
|
|
struct drm_display_mode *mode,
|
|
void *display, const struct msm_resource_caps_info *avail_res);
|
|
|
|
/**
|
|
* dsi_conn_enable_event - callback to notify DSI driver of event registration
|
|
* @connector: Pointer to drm connector structure
|
|
* @event_idx: Connector event index
|
|
* @enable: Whether or not the event is enabled
|
|
* @display: Pointer to private display handle
|
|
*/
|
|
void dsi_conn_enable_event(struct drm_connector *connector,
|
|
uint32_t event_idx, bool enable, void *display);
|
|
|
|
struct dsi_bridge *dsi_drm_bridge_init(struct dsi_display *display,
|
|
struct drm_device *dev,
|
|
struct drm_encoder *encoder);
|
|
|
|
void dsi_drm_bridge_cleanup(struct dsi_bridge *bridge);
|
|
|
|
/**
|
|
* 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_conn_pre_kickoff(struct drm_connector *connector,
|
|
void *display,
|
|
struct msm_display_kickoff_params *params);
|
|
|
|
/**
|
|
* dsi_display_post_kickoff - program post kickoff-time features
|
|
* @connector: Pointer to drm connector structure
|
|
* @params: Parameters for post kickoff programming
|
|
* Returns: Zero on success
|
|
*/
|
|
int dsi_conn_post_kickoff(struct drm_connector *connector,
|
|
struct msm_display_conn_params *params);
|
|
|
|
/**
|
|
* dsi_convert_to_drm_mode - Update drm mode with dsi mode information
|
|
* @dsi_mode: input parameter. structure having dsi mode information.
|
|
* @drm_mode: output parameter. DRM mode set for the display
|
|
*/
|
|
void dsi_convert_to_drm_mode(const struct dsi_display_mode *dsi_mode,
|
|
struct drm_display_mode *drm_mode);
|
|
|
|
u64 dsi_drm_find_bit_clk_rate(void *display,
|
|
const struct drm_display_mode *drm_mode);
|
|
|
|
/**
|
|
* dsi_conn_prepare_commit - program pre commit time features
|
|
* @display: Pointer to private display structure
|
|
* @params: Parameters for pre commit programming
|
|
* Returns: Zero on success
|
|
*/
|
|
int dsi_conn_prepare_commit(void *display,
|
|
struct msm_display_conn_params *params);
|
|
|
|
/**
|
|
* dsi_set_allowed_mode_switch - set allowed mode switch bitmask
|
|
* @connector: Pointer to drm connector structure
|
|
* @display: Pointer to private display structure
|
|
*/
|
|
void dsi_conn_set_allowed_mode_switch(struct drm_connector *connector,
|
|
void *display);
|
|
|
|
#endif /* _DSI_DRM_H_ */
|