mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
drm/msm: move msm notify functon from msm to soc
Move msm notify helper functions from msm to soc to make sure the function is valid if DRM MSM is not compiled. Also add MSM_DRM_TECHPACK option to select dependent modules that are selected by DRM MSM. This will allow defconfig to have the flexibility to select builtin DRM MSM or external techpack. Change-Id: I6b0cc8f31b5c185907683c6347e5a594fa2101ad Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
This commit is contained in:
parent
942b1f1fa3
commit
75178f0058
@ -896,6 +896,42 @@ config MSM_PERFORMANCE
|
||||
when requested by the userspace by changing the cpufreq policy
|
||||
fmin and fmax.
|
||||
|
||||
config MSM_DRM_NOTIFY
|
||||
bool
|
||||
depends on !DRM_MSM
|
||||
help
|
||||
This driver can register and receive notification for MSM_DRM
|
||||
power event in external module. When display power state is
|
||||
updated, any modules registered to the block chain will get
|
||||
notified.
|
||||
|
||||
config MSM_DRM_TECHPACK
|
||||
bool "Enable MSM DRM from techpack"
|
||||
depends on DRM
|
||||
depends on ARCH_QCOM || (ARM && COMPILE_TEST)
|
||||
depends on OF
|
||||
depends on MMU
|
||||
depends on !DRM_MSM
|
||||
select QCOM_MDT_LOADER if ARCH_QCOM
|
||||
select REGULATOR
|
||||
select DRM_KMS_HELPER
|
||||
select DRM_PANEL
|
||||
select SHMEM
|
||||
select TMPFS
|
||||
select QCOM_SCM
|
||||
select SND_SOC_HDMI_CODEC if SND_SOC
|
||||
select SYNC_FILE
|
||||
select MSM_EXT_DISPLAY
|
||||
select PM_GENERIC_DOMAINS
|
||||
select V4L2_MEM2MEM_DEV
|
||||
select DRM_MIPI_DSI
|
||||
select MSM_DRM_NOTIFY
|
||||
help
|
||||
The DRM MSM TECHPACK will select modules that are required by
|
||||
DRM MSM module. This option is only used when DRM MSM is loaded
|
||||
from external techpack, and is mutually exclusive with builtin
|
||||
DRM MSM module.
|
||||
|
||||
config QMP_DEBUGFS_CLIENT
|
||||
bool "Debugfs Client to communicate with AOP using QMP protocol"
|
||||
depends on DEBUG_FS
|
||||
|
@ -96,6 +96,7 @@ ifdef CONFIG_MSM_RPM_SMD
|
||||
endif
|
||||
obj-$(CONFIG_QMP_DEBUGFS_CLIENT) += qmp-debugfs-client.o
|
||||
obj-$(CONFIG_MSM_PERFORMANCE) += msm_performance.o
|
||||
obj-$(CONFIG_MSM_DRM_NOTIFY) += msm_drm_notify.o
|
||||
ifdef CONFIG_DEBUG_FS
|
||||
obj-$(CONFIG_MSM_RPM_SMD) += rpm-smd-debug.o
|
||||
endif
|
||||
|
58
drivers/soc/qcom/msm_drm_notify.c
Normal file
58
drivers/soc/qcom/msm_drm_notify.c
Normal file
@ -0,0 +1,58 @@
|
||||
/* Copyright (c) 2020, 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
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/msm_drm_notify.h>
|
||||
|
||||
static BLOCKING_NOTIFIER_HEAD(msm_drm_notifier_list);
|
||||
|
||||
/**
|
||||
* msm_drm_register_client - register a client notifier
|
||||
* @nb: notifier block to callback on events
|
||||
*
|
||||
* This function registers a notifier callback function
|
||||
* to msm_drm_notifier_list, which would be called when
|
||||
* received unblank/power down event.
|
||||
*/
|
||||
int msm_drm_register_client(struct notifier_block *nb)
|
||||
{
|
||||
return blocking_notifier_chain_register(&msm_drm_notifier_list,
|
||||
nb);
|
||||
}
|
||||
EXPORT_SYMBOL(msm_drm_register_client);
|
||||
|
||||
/**
|
||||
* msm_drm_unregister_client - unregister a client notifier
|
||||
* @nb: notifier block to callback on events
|
||||
*
|
||||
* This function unregisters the callback function from
|
||||
* msm_drm_notifier_list.
|
||||
*/
|
||||
int msm_drm_unregister_client(struct notifier_block *nb)
|
||||
{
|
||||
return blocking_notifier_chain_unregister(&msm_drm_notifier_list,
|
||||
nb);
|
||||
}
|
||||
EXPORT_SYMBOL(msm_drm_unregister_client);
|
||||
|
||||
/**
|
||||
* msm_drm_notifier_call_chain - notify clients of drm_events
|
||||
* @val: event MSM_DRM_EARLY_EVENT_BLANK or MSM_DRM_EVENT_BLANK
|
||||
* @v: notifier data, inculde display id and display blank
|
||||
* event(unblank or power down).
|
||||
*/
|
||||
int msm_drm_notifier_call_chain(unsigned long val, void *v)
|
||||
{
|
||||
return blocking_notifier_call_chain(&msm_drm_notifier_list, val,
|
||||
v);
|
||||
}
|
||||
EXPORT_SYMBOL(msm_drm_notifier_call_chain);
|
Loading…
x
Reference in New Issue
Block a user