disp: msm: add support for vm event register framework
Besides SDE, other subdrivers may be interested in participating in the VM switch. This change provides framework for display dependent drivers like DSI, DP and RSCC to register for various VM switch event hooks. The following hooks to provided through msm_vm_ops: post_hw_acquire: invoked before the first frame push after gaining HW access. pre_hw_release: invoked after the last frame commit before releasing the HW. check: check with vm clients for their readiness for HW releasing. Change-Id: I616db04e979f78f76f6f97ee3b068dd348339ab6 Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
This commit is contained in:
61
include/linux/sde_vm_event.h
Normal file
61
include/linux/sde_vm_event.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __SDE_VM_EVENT_H__
|
||||
#define __SDE_VM_EVENT_H__
|
||||
|
||||
#include <linux/list.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <drm/drm_device.h>
|
||||
|
||||
/**
|
||||
* struct msm_vm_ops - hooks for communication with vm clients
|
||||
* @vm_pre_hw_release: invoked before releasing the HW
|
||||
* @vm_post_hw_acquire: invoked before pushing the first commit
|
||||
* @vm_check: invoked to check the readiness of the vm_clients
|
||||
* before releasing the HW
|
||||
*/
|
||||
struct msm_vm_ops {
|
||||
int (*vm_pre_hw_release)(void *priv_data);
|
||||
int (*vm_post_hw_acquire)(void *priv_data);
|
||||
int (*vm_check)(void *priv_data);
|
||||
};
|
||||
|
||||
/**
|
||||
* msm_vm_client_entry - defines the vm client info
|
||||
* @ops: client vm_ops
|
||||
* @dev: clients device id. Used in unregister
|
||||
* @data: client custom data
|
||||
* @list: linked list entry
|
||||
*/
|
||||
struct msm_vm_client_entry {
|
||||
struct msm_vm_ops ops;
|
||||
struct device *dev;
|
||||
void *data;
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
/**
|
||||
* msm_register_vm_event - api for display dependent drivers(clients) to
|
||||
* register for vm events
|
||||
* @dev: msm device
|
||||
* @client_dev: client device
|
||||
* @ops: vm event hooks
|
||||
* @priv_data: client custom data
|
||||
*/
|
||||
int msm_register_vm_event(struct device *dev, struct device *client_dev,
|
||||
struct msm_vm_ops *ops, void *priv_data);
|
||||
|
||||
/**
|
||||
* msm_unregister_vm_event - api for display dependent drivers(clients) to
|
||||
* unregister from vm events
|
||||
* @dev: msm device
|
||||
* @client_dev: client device
|
||||
*/
|
||||
void msm_unregister_vm_event(struct device *dev, struct device *client_dev);
|
||||
|
||||
#endif //__SDE_VM_EVENT_H__
|
Reference in New Issue
Block a user