Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sm8250-mainline
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jianhua Lu
sm8250-mainline
Commits
1e8d18f0
Commit
1e8d18f0
authored
2 years ago
by
Jianhua Lu
Browse files
Options
Downloads
Patches
Plain Diff
drm: Add drm notifier support
parent
ffd294d3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
drivers/gpu/drm/Makefile
+1
-0
1 addition, 0 deletions
drivers/gpu/drm/Makefile
drivers/gpu/drm/drm_notifier.c
+58
-0
58 additions, 0 deletions
drivers/gpu/drm/drm_notifier.c
include/drm/drm_notifier.h
+37
-0
37 additions, 0 deletions
include/drm/drm_notifier.h
with
96 additions
and
0 deletions
drivers/gpu/drm/Makefile
+
1
−
0
View file @
1e8d18f0
...
...
@@ -72,6 +72,7 @@ drm-y := \
drm_vblank.o
\
drm_vblank_work.o
\
drm_vma_manager.o
\
drm_notifier.o
\
drm_writeback.o
drm-$(CONFIG_DRM_CLIENT)
+=
\
drm_client.o
\
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/drm_notifier.c
0 → 100644
+
58
−
0
View file @
1e8d18f0
/*
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
* Copyright (C) 2021 XiaoMi, Inc.
*
* 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/notifier.h>
#include
<drm/drm_notifier.h>
static
BLOCKING_NOTIFIER_HEAD
(
mi_drm_notifier_list
);
/**
* mi_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
mi_drm_register_client
(
struct
notifier_block
*
nb
)
{
return
blocking_notifier_chain_register
(
&
mi_drm_notifier_list
,
nb
);
}
EXPORT_SYMBOL
(
mi_drm_register_client
);
/**
* mi_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
mi_drm_unregister_client
(
struct
notifier_block
*
nb
)
{
return
blocking_notifier_chain_unregister
(
&
mi_drm_notifier_list
,
nb
);
}
EXPORT_SYMBOL
(
mi_drm_unregister_client
);
/**
* mi_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
mi_drm_notifier_call_chain
(
unsigned
long
val
,
void
*
v
)
{
return
blocking_notifier_call_chain
(
&
mi_drm_notifier_list
,
val
,
v
);
}
EXPORT_SYMBOL
(
mi_drm_notifier_call_chain
);
This diff is collapsed.
Click to expand it.
include/drm/drm_notifier.h
0 → 100644
+
37
−
0
View file @
1e8d18f0
/*
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
* Copyright (C) 2021 XiaoMi, Inc.
*
* 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.
*
*/
#ifndef _DRM_NOTIFIER_H_
#define _DRM_NOTIFIER_H_
#include
<linux/notifier.h>
/* A hardware display blank change occurred */
#define MI_DRM_EVENT_BLANK 0x01
/* A hardware display blank early change occurred */
#define MI_DRM_EARLY_EVENT_BLANK 0x02
enum
drm_notifier_data
{
/* panel: power on */
MI_DRM_BLANK_UNBLANK
,
/* panel: power down */
MI_DRM_BLANK_POWERDOWN
,
};
int
mi_drm_register_client
(
struct
notifier_block
*
nb
);
int
mi_drm_unregister_client
(
struct
notifier_block
*
nb
);
int
mi_drm_notifier_call_chain
(
unsigned
long
val
,
void
*
v
);
#endif
/* _DRM_NOTIFIER_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment