Loading include/linux/sde_io_util.h +6 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,12 @@ struct dss_module_power { int msm_dss_ioremap_byname(struct platform_device *pdev, struct dss_io_data *io_data, const char *name); void msm_dss_iounmap(struct dss_io_data *io_data); int msm_dss_get_io_mem(struct platform_device *pdev, struct list_head *mem_list); void msm_dss_clean_io_mem(struct list_head *mem_list); int msm_dss_get_io_irq(struct platform_device *pdev, struct list_head *irq_list, u32 label); void msm_dss_clean_io_irq(struct list_head *irq_list); int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable); int msm_dss_gpio_enable(struct dss_gpio *in_gpio, int num_gpio, int enable); Loading include/linux/sde_vm_event.h 0 → 100644 +97 −0 Original line number Diff line number Diff line /* 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_io_irq_entry - define irq item * @label: hh_irq_label for the irq * @irq_num: linux mapped irq num * @list: list head pointer */ struct msm_io_irq_entry { u32 label; u32 irq_num; struct list_head list; }; /** * struct - msm_io_mem_entry - define io memory item * @base: reg base * @size: size of the reg range * @list: list head pointer */ struct msm_io_mem_entry { phys_addr_t base; phys_addr_t size; struct list_head list; }; /** * struct - msm_io_res - represents the hw resources for vm sharing * @irq: list of IRQ's of all the dislay sub-devices * @mem: list of IO memory ranges of all the display sub-devices */ struct msm_io_res { struct list_head irq; struct list_head mem; }; /** * 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 * @vm_get_io_resources: invoked to collect HW resources */ 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); int (*vm_get_io_resources)(struct msm_io_res *io_res, 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__ msm/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ msm_drm-$(CONFIG_DRM_MSM_SDE) += sde/sde_crtc.o \ sde/sde_color_processing.o \ sde/sde_vbif.o \ sde_io_util.o \ sde_vm_event.o \ sde/sde_hw_reg_dma_v1_color_proc.o \ sde/sde_hw_color_proc_v4.o \ sde/sde_hw_ad4.o \ Loading msm/msm_drv.c +15 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,7 @@ static int msm_drm_uninit(struct device *dev) struct drm_device *ddev = platform_get_drvdata(pdev); struct msm_drm_private *priv = ddev->dev_private; struct msm_kms *kms = priv->kms; struct msm_vm_client_entry *client_entry, *tmp; int i; /* We must cancel and cleanup any pending vblank enable/disable Loading Loading @@ -455,6 +456,17 @@ static int msm_drm_uninit(struct device *dev) sde_power_resource_deinit(pdev, &priv->phandle); mutex_lock(&priv->vm_client_lock); /* clean up any unregistered clients */ list_for_each_entry_safe(client_entry, tmp, &priv->vm_client_list, list) { list_del(&client_entry->list); kfree(client_entry); } mutex_unlock(&priv->vm_client_lock); msm_mdss_destroy(ddev); ddev->dev_private = NULL; Loading Loading @@ -831,6 +843,9 @@ static int msm_drm_component_init(struct device *dev) INIT_LIST_HEAD(&priv->client_event_list); INIT_LIST_HEAD(&priv->inactive_list); INIT_LIST_HEAD(&priv->vm_client_list); mutex_init(&priv->vm_client_lock); /* Bind all our sub-components: */ ret = msm_component_bind_all(dev, ddev); Loading msm/msm_drv.h +4 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <linux/of_graph.h> #include <linux/of_device.h> #include <linux/sde_io_util.h> #include <linux/sde_vm_event.h> #include <linux/sizes.h> #include <linux/kthread.h> Loading Loading @@ -922,6 +923,9 @@ struct msm_drm_private { /* update the flag when msm driver receives shutdown notification */ bool shutdown_in_progress; struct mutex vm_client_lock; struct list_head vm_client_list; }; /* get struct msm_kms * from drm_device * */ Loading Loading
include/linux/sde_io_util.h +6 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,12 @@ struct dss_module_power { int msm_dss_ioremap_byname(struct platform_device *pdev, struct dss_io_data *io_data, const char *name); void msm_dss_iounmap(struct dss_io_data *io_data); int msm_dss_get_io_mem(struct platform_device *pdev, struct list_head *mem_list); void msm_dss_clean_io_mem(struct list_head *mem_list); int msm_dss_get_io_irq(struct platform_device *pdev, struct list_head *irq_list, u32 label); void msm_dss_clean_io_irq(struct list_head *irq_list); int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable); int msm_dss_gpio_enable(struct dss_gpio *in_gpio, int num_gpio, int enable); Loading
include/linux/sde_vm_event.h 0 → 100644 +97 −0 Original line number Diff line number Diff line /* 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_io_irq_entry - define irq item * @label: hh_irq_label for the irq * @irq_num: linux mapped irq num * @list: list head pointer */ struct msm_io_irq_entry { u32 label; u32 irq_num; struct list_head list; }; /** * struct - msm_io_mem_entry - define io memory item * @base: reg base * @size: size of the reg range * @list: list head pointer */ struct msm_io_mem_entry { phys_addr_t base; phys_addr_t size; struct list_head list; }; /** * struct - msm_io_res - represents the hw resources for vm sharing * @irq: list of IRQ's of all the dislay sub-devices * @mem: list of IO memory ranges of all the display sub-devices */ struct msm_io_res { struct list_head irq; struct list_head mem; }; /** * 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 * @vm_get_io_resources: invoked to collect HW resources */ 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); int (*vm_get_io_resources)(struct msm_io_res *io_res, 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__
msm/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ msm_drm-$(CONFIG_DRM_MSM_SDE) += sde/sde_crtc.o \ sde/sde_color_processing.o \ sde/sde_vbif.o \ sde_io_util.o \ sde_vm_event.o \ sde/sde_hw_reg_dma_v1_color_proc.o \ sde/sde_hw_color_proc_v4.o \ sde/sde_hw_ad4.o \ Loading
msm/msm_drv.c +15 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,7 @@ static int msm_drm_uninit(struct device *dev) struct drm_device *ddev = platform_get_drvdata(pdev); struct msm_drm_private *priv = ddev->dev_private; struct msm_kms *kms = priv->kms; struct msm_vm_client_entry *client_entry, *tmp; int i; /* We must cancel and cleanup any pending vblank enable/disable Loading Loading @@ -455,6 +456,17 @@ static int msm_drm_uninit(struct device *dev) sde_power_resource_deinit(pdev, &priv->phandle); mutex_lock(&priv->vm_client_lock); /* clean up any unregistered clients */ list_for_each_entry_safe(client_entry, tmp, &priv->vm_client_list, list) { list_del(&client_entry->list); kfree(client_entry); } mutex_unlock(&priv->vm_client_lock); msm_mdss_destroy(ddev); ddev->dev_private = NULL; Loading Loading @@ -831,6 +843,9 @@ static int msm_drm_component_init(struct device *dev) INIT_LIST_HEAD(&priv->client_event_list); INIT_LIST_HEAD(&priv->inactive_list); INIT_LIST_HEAD(&priv->vm_client_list); mutex_init(&priv->vm_client_lock); /* Bind all our sub-components: */ ret = msm_component_bind_all(dev, ddev); Loading
msm/msm_drv.h +4 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <linux/of_graph.h> #include <linux/of_device.h> #include <linux/sde_io_util.h> #include <linux/sde_vm_event.h> #include <linux/sizes.h> #include <linux/kthread.h> Loading Loading @@ -922,6 +923,9 @@ struct msm_drm_private { /* update the flag when msm driver receives shutdown notification */ bool shutdown_in_progress; struct mutex vm_client_lock; struct list_head vm_client_list; }; /* get struct msm_kms * from drm_device * */ Loading