File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2080,6 +2080,16 @@ static bool tegra_dc_has_window_groups(struct tegra_dc *dc)
20802080 return false;
20812081}
20822082
2083+ static int tegra_dc_early_init (struct host1x_client * client )
2084+ {
2085+ struct drm_device * drm = dev_get_drvdata (client -> host );
2086+ struct tegra_drm * tegra = drm -> dev_private ;
2087+
2088+ tegra -> num_crtcs ++ ;
2089+
2090+ return 0 ;
2091+ }
2092+
20832093static int tegra_dc_init (struct host1x_client * client )
20842094{
20852095 struct drm_device * drm = dev_get_drvdata (client -> host );
@@ -2228,6 +2238,16 @@ static int tegra_dc_exit(struct host1x_client *client)
22282238 return 0 ;
22292239}
22302240
2241+ static int tegra_dc_late_exit (struct host1x_client * client )
2242+ {
2243+ struct drm_device * drm = dev_get_drvdata (client -> host );
2244+ struct tegra_drm * tegra = drm -> dev_private ;
2245+
2246+ tegra -> num_crtcs -- ;
2247+
2248+ return 0 ;
2249+ }
2250+
22312251static int tegra_dc_runtime_suspend (struct host1x_client * client )
22322252{
22332253 struct tegra_dc * dc = host1x_client_to_dc (client );
@@ -2292,8 +2312,10 @@ static int tegra_dc_runtime_resume(struct host1x_client *client)
22922312}
22932313
22942314static const struct host1x_client_ops dc_client_ops = {
2315+ .early_init = tegra_dc_early_init ,
22952316 .init = tegra_dc_init ,
22962317 .exit = tegra_dc_exit ,
2318+ .late_exit = tegra_dc_late_exit ,
22972319 .suspend = tegra_dc_runtime_suspend ,
22982320 .resume = tegra_dc_runtime_resume ,
22992321};
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ struct tegra_drm {
5656
5757 unsigned int hmask , vmask ;
5858 unsigned int pitch_align ;
59+ unsigned int num_crtcs ;
5960
6061 struct tegra_display_hub * hub ;
6162};
Original file line number Diff line number Diff line change @@ -562,9 +562,8 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
562562 enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY ;
563563 struct tegra_drm * tegra = drm -> dev_private ;
564564 struct tegra_display_hub * hub = tegra -> hub ;
565- /* planes can be assigned to arbitrary CRTCs */
566- unsigned int possible_crtcs = 0x7 ;
567565 struct tegra_shared_plane * plane ;
566+ unsigned int possible_crtcs ;
568567 unsigned int num_formats ;
569568 const u64 * modifiers ;
570569 struct drm_plane * p ;
@@ -583,6 +582,9 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
583582
584583 p = & plane -> base .base ;
585584
585+ /* planes can be assigned to arbitrary CRTCs */
586+ possible_crtcs = BIT (tegra -> num_crtcs ) - 1 ;
587+
586588 num_formats = ARRAY_SIZE (tegra_shared_plane_formats );
587589 formats = tegra_shared_plane_formats ;
588590 modifiers = tegra_shared_plane_modifiers ;
You can’t perform that action at this time.
0 commit comments