Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25e5eaf1 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/panel: Add a panel notifier list into drm_panel"

parents f1ac8c57 a14a49cb
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ static LIST_HEAD(panel_list);
void drm_panel_init(struct drm_panel *panel)
{
	INIT_LIST_HEAD(&panel->list);
	BLOCKING_INIT_NOTIFIER_HEAD(&panel->nh);
}
EXPORT_SYMBOL(drm_panel_init);

@@ -169,6 +170,27 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np)
EXPORT_SYMBOL(of_drm_find_panel);
#endif

int drm_panel_notifier_register(struct drm_panel *panel,
	struct notifier_block *nb)
{
	return blocking_notifier_chain_register(&panel->nh, nb);
}
EXPORT_SYMBOL(drm_panel_notifier_register);

int drm_panel_notifier_unregister(struct drm_panel *panel,
	struct notifier_block *nb)
{
	return blocking_notifier_chain_unregister(&panel->nh, nb);
}
EXPORT_SYMBOL(drm_panel_notifier_unregister);

int drm_panel_notifier_call_chain(struct drm_panel *panel,
	unsigned long val, void *v)
{
	return blocking_notifier_call_chain(&panel->nh, val, v);
}
EXPORT_SYMBOL(drm_panel_notifier_call_chain);

MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
MODULE_DESCRIPTION("DRM panel infrastructure");
MODULE_LICENSE("GPL and additional rights");
+7 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ struct drm_encoder;
struct drm_property;
struct drm_property_blob;
struct drm_printer;
struct drm_panel;
struct edid;

enum drm_connector_force {
@@ -1121,6 +1122,12 @@ struct drm_connector {
	 * &drm_mode_config.connector_free_work.
	 */
	struct llist_node free_node;
	/**
	 * @panel:
	 *
	 * Can find the panel which connected to drm_connector.
	 */
	struct drm_panel *panel;
};

#define obj_to_connector(x) container_of(x, struct drm_connector, base)
+26 −0
Original line number Diff line number Diff line
@@ -26,6 +26,23 @@

#include <linux/errno.h>
#include <linux/list.h>
#include <linux/notifier.h>

/* A hardware display blank change occurred */
#define DRM_PANEL_EVENT_BLANK		0x01
/* A hardware display blank early change occurred */
#define DRM_PANEL_EARLY_EVENT_BLANK	0x02

enum {
	/* panel: power on */
	DRM_PANEL_BLANK_UNBLANK,
	/* panel: power off */
	DRM_PANEL_BLANK_POWERDOWN,
};

struct drm_panel_notifier {
	void *data;
};

struct device_node;
struct drm_connector;
@@ -84,6 +101,7 @@ struct drm_panel_funcs {
 * @dev: parent device of the panel
 * @funcs: operations that can be performed on the panel
 * @list: panel entry in registry
 * @nh: panel notifier list head
 */
struct drm_panel {
	struct drm_device *drm;
@@ -93,6 +111,7 @@ struct drm_panel {
	const struct drm_panel_funcs *funcs;

	struct list_head list;
	struct blocking_notifier_head nh;
};

/**
@@ -194,6 +213,13 @@ void drm_panel_remove(struct drm_panel *panel);
int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector);
int drm_panel_detach(struct drm_panel *panel);

int drm_panel_notifier_register(struct drm_panel *panel,
	struct notifier_block *nb);
int drm_panel_notifier_unregister(struct drm_panel *panel,
	struct notifier_block *nb);
int drm_panel_notifier_call_chain(struct drm_panel *panel,
	unsigned long val, void *v);

#if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
struct drm_panel *of_drm_find_panel(const struct device_node *np);
#else