diff options
| author | Shu Zhong <shuz@nvidia.com> | 2017-10-20 02:24:21 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-03 01:06:03 -0500 |
| commit | 66a07513fd3667be3f2e0a8d4006ee0388eb2c3e (patch) | |
| tree | e413c9b23d8238ccab0c2d33809424a1635d4096 /include/video | |
| parent | 2c3a037264505c2f0bd5fb85f9d0b44048e8f9fe (diff) | |
dc: include: add IMP caps interface
In order to run the display IMP algorithm in userspace,
certain input parameters need to be exported from kernel
to userspace. TEGRA_DC_EXT_GET_IMP_USER_INFO is the existing ioctl
that's used for this purpose, but the interface that it exposes
is very rigid.
To address these design issues, this patch adds a new IMP cap
type to the existing dc_ext cap info framework. This cap type
will currently return three main pieces of information:
- The system-level MC/IHUB parameters that the IMP algorithm needs
from kernel
- The EMC DVFS table for the current platform
- The thread group information for each window
Once all userspace clients move to the new cap framework,
TEGRA_DC_EXT_GET_IMP_USER_INFO will be deleted.
TDS-2830
Change-Id: Ib67daeb430c6e00bbba3bac8cbc463c6e873376c
Signed-off-by: Shu Zhong <shuz@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1612849
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/video')
| -rw-r--r-- | include/video/tegra_dc_ext.h | 95 |
1 files changed, 92 insertions, 3 deletions
diff --git a/include/video/tegra_dc_ext.h b/include/video/tegra_dc_ext.h index d541269d0..d32d7ce30 100644 --- a/include/video/tegra_dc_ext.h +++ b/include/video/tegra_dc_ext.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * tegra_dc_ext.h: tegra dc ext interface. | 2 | * tegra_dc_ext.h: tegra dc ext interface. |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2011-2017, NVIDIA Corporation. All rights reserved. | 4 | * Copyright (C) 2011-2018, NVIDIA Corporation. All rights reserved. |
| 5 | * | 5 | * |
| 6 | * Author: Robert Morell <rmorell@nvidia.com> | 6 | * Author: Robert Morell <rmorell@nvidia.com> |
| 7 | * Some code based on fbdev extensions written by: | 7 | * Some code based on fbdev extensions written by: |
| @@ -702,8 +702,12 @@ struct tegra_dc_ext_set_vblank { | |||
| 702 | __u8 reserved[3]; /* unused - must be 0 */ | 702 | __u8 reserved[3]; /* unused - must be 0 */ |
| 703 | }; | 703 | }; |
| 704 | 704 | ||
| 705 | /* tegra_dc_ext_cap_type : Defines the diffrent types of capability info that | 705 | /* |
| 706 | * could be provided by the kernel to user space. | 706 | * tegra_dc_ext_cap_type : Defines the different types of per-display capability |
| 707 | * info that could be provided by the kernel to user space. | ||
| 708 | * | ||
| 709 | * These cap types are specific to the tegra_dc_ext device that they're queried | ||
| 710 | * from. | ||
| 707 | */ | 711 | */ |
| 708 | enum tegra_dc_ext_cap_type { | 712 | enum tegra_dc_ext_cap_type { |
| 709 | TEGRA_DC_EXT_CAP_TYPE_NONE, /* dummy value - do not use */ | 713 | TEGRA_DC_EXT_CAP_TYPE_NONE, /* dummy value - do not use */ |
| @@ -712,6 +716,20 @@ enum tegra_dc_ext_cap_type { | |||
| 712 | }; | 716 | }; |
| 713 | 717 | ||
| 714 | /* | 718 | /* |
| 719 | * tegra_dc_ext_control_cap_type : Defines the different types of | ||
| 720 | * SOC-level/common capability info that could be provided by the kernel to user | ||
| 721 | * space. | ||
| 722 | * | ||
| 723 | * These cap types are queried from the common tegra_dc_control device. | ||
| 724 | */ | ||
| 725 | enum tegra_dc_ext_control_cap_type { | ||
| 726 | TEGRA_DC_EXT_CONTROL_CAP_TYPE_NONE, /* dummy value - do not use */ | ||
| 727 | /* struct tegra_dc_ext_imp_caps - only for NVDISPLAY */ | ||
| 728 | TEGRA_DC_EXT_CONTROL_CAP_TYPE_IMP, | ||
| 729 | TEGRA_DC_EXT_CONTROL_CAP_TYPE_MAX, | ||
| 730 | }; | ||
| 731 | |||
| 732 | /* | ||
| 715 | * tegra_dc_ext_hdr_caps : Incorporates target display's hdr capabilities. | 733 | * tegra_dc_ext_hdr_caps : Incorporates target display's hdr capabilities. |
| 716 | * nr_elements : Indicates the number of the following data. When set to 0, | 734 | * nr_elements : Indicates the number of the following data. When set to 0, |
| 717 | * the sink didn't provide the hdr static metadata in the edid. | 735 | * the sink didn't provide the hdr static metadata in the edid. |
| @@ -745,6 +763,75 @@ struct tegra_dc_ext_hdr_caps { | |||
| 745 | }; | 763 | }; |
| 746 | 764 | ||
| 747 | /* | 765 | /* |
| 766 | * tegra_dc_ext_imp_thread_info: Encapsulates the thread group information for | ||
| 767 | * a given window | ||
| 768 | * | ||
| 769 | * win_id: The HW id of the window that the client is requesting info for | ||
| 770 | * | ||
| 771 | * thread_group: The thread group that's assigned to the given window. | ||
| 772 | * Each window can only be assigned one thread group, as long as that thread | ||
| 773 | * group isn't already assigned. A value of -1 indicates that no thread group is | ||
| 774 | * assigned to this window. | ||
| 775 | */ | ||
| 776 | struct tegra_dc_ext_imp_thread_info { | ||
| 777 | __u8 win_id; /* in - filled in by client */ | ||
| 778 | __s8 thread_group; | ||
| 779 | |||
| 780 | __u64 reserved[4]; | ||
| 781 | } __attribute__((__packed__)); | ||
| 782 | |||
| 783 | /* | ||
| 784 | * tegra_dc_ext_imp_mc_caps: Encapsulates the system-level MC/IHUB configs that | ||
| 785 | * need to be exported from kernel to userspace for IMP | ||
| 786 | */ | ||
| 787 | struct tegra_dc_ext_imp_mc_caps { | ||
| 788 | __u64 peak_hubclk_hz; | ||
| 789 | __u32 num_dram_channels; | ||
| 790 | __u32 total_mempool_size_bytes; | ||
| 791 | __u32 request_batch_size; | ||
| 792 | |||
| 793 | __u64 reserved[8]; /* must be zero */ | ||
| 794 | } __attribute__((__packed__)); | ||
| 795 | |||
| 796 | /* | ||
| 797 | * tegra_dc_ext_imp_caps: Encapsulates the IMP caps that kernel needs to export | ||
| 798 | * to userspace | ||
| 799 | * | ||
| 800 | * mc_caps: The system-level MC/IHUB configs required for IMP | ||
| 801 | * | ||
| 802 | * num_dvfs_requested: The number of EMC DVFS pairs requested by the client. | ||
| 803 | * A safe number to use here is 14, since that's the max number of entries | ||
| 804 | * that's currently hardcoded in the bpmp ABI headers. | ||
| 805 | * | ||
| 806 | * num_dvfs_returned: The number of EMC DVFS pairs that kernel was able to copy | ||
| 807 | * back to the client. If the number of requested pairs is less than the number | ||
| 808 | * of available entries, the first lower num_dvfs_requested pairs will be | ||
| 809 | * returned. | ||
| 810 | * | ||
| 811 | * dvfs_pairs: The actual EMC DVFS pairs. The client is responsible for | ||
| 812 | * allocating enough memory for at least num_dvfs_requested pairs. | ||
| 813 | * | ||
| 814 | * num_thread_info: The number of thread info entries requested by the client. | ||
| 815 | * This cannot exceed the total number of windows that are supported on the | ||
| 816 | * underlying SOC. | ||
| 817 | * | ||
| 818 | * thread_info: The actual thread info entries. The client is responsible for | ||
| 819 | * allocating enough memory for at least num_thread_info entries. | ||
| 820 | */ | ||
| 821 | struct tegra_dc_ext_imp_caps { | ||
| 822 | struct tegra_dc_ext_imp_mc_caps mc_caps; | ||
| 823 | |||
| 824 | __u32 num_dvfs_requested; /* in - filled in by client */ | ||
| 825 | __u32 num_dvfs_returned; | ||
| 826 | struct tegra_dc_ext_imp_emc_dvfs_pair __user *dvfs_pairs; | ||
| 827 | |||
| 828 | __u32 num_thread_info; /* in - filled in by client */ | ||
| 829 | struct tegra_dc_ext_imp_thread_info __user *thread_info; | ||
| 830 | |||
| 831 | __u64 reserved[8]; /* must be zero */ | ||
| 832 | } __attribute__((__packed__)); | ||
| 833 | |||
| 834 | /* | ||
| 748 | * tegra_dc_ext_caps : Incorporates target display capabilities. | 835 | * tegra_dc_ext_caps : Incorporates target display capabilities. |
| 749 | * data_type : Indicates the type of capability. | 836 | * data_type : Indicates the type of capability. |
| 750 | * data = pointer to the actual data. | 837 | * data = pointer to the actual data. |
| @@ -1643,5 +1730,7 @@ struct tegra_dc_ext_crc_arg { | |||
| 1643 | _IOW('C', 0x07, struct tegra_dc_ext_control_scrncapt_resume) | 1730 | _IOW('C', 0x07, struct tegra_dc_ext_control_scrncapt_resume) |
| 1644 | #define TEGRA_DC_EXT_CONTROL_SET_FRAME_LOCK_PARAMS\ | 1731 | #define TEGRA_DC_EXT_CONTROL_SET_FRAME_LOCK_PARAMS\ |
| 1645 | _IOW('C', 0x08, struct tegra_dc_ext_control_scrncapt_resume) | 1732 | _IOW('C', 0x08, struct tegra_dc_ext_control_scrncapt_resume) |
| 1733 | #define TEGRA_DC_EXT_CONTROL_GET_CAP_INFO \ | ||
| 1734 | _IOWR('C', 0x09, struct tegra_dc_ext_get_cap_info) | ||
| 1646 | 1735 | ||
| 1647 | #endif /* __TEGRA_DC_EXT_H */ | 1736 | #endif /* __TEGRA_DC_EXT_H */ |
