File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed 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)
2080
2080
return false;
2081
2081
}
2082
2082
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
+
2083
2093
static int tegra_dc_init (struct host1x_client * client )
2084
2094
{
2085
2095
struct drm_device * drm = dev_get_drvdata (client -> host );
@@ -2228,6 +2238,16 @@ static int tegra_dc_exit(struct host1x_client *client)
2228
2238
return 0 ;
2229
2239
}
2230
2240
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
+
2231
2251
static int tegra_dc_runtime_suspend (struct host1x_client * client )
2232
2252
{
2233
2253
struct tegra_dc * dc = host1x_client_to_dc (client );
@@ -2292,8 +2312,10 @@ static int tegra_dc_runtime_resume(struct host1x_client *client)
2292
2312
}
2293
2313
2294
2314
static const struct host1x_client_ops dc_client_ops = {
2315
+ .early_init = tegra_dc_early_init ,
2295
2316
.init = tegra_dc_init ,
2296
2317
.exit = tegra_dc_exit ,
2318
+ .late_exit = tegra_dc_late_exit ,
2297
2319
.suspend = tegra_dc_runtime_suspend ,
2298
2320
.resume = tegra_dc_runtime_resume ,
2299
2321
};
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ struct tegra_drm {
56
56
57
57
unsigned int hmask , vmask ;
58
58
unsigned int pitch_align ;
59
+ unsigned int num_crtcs ;
59
60
60
61
struct tegra_display_hub * hub ;
61
62
};
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,
562
562
enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY ;
563
563
struct tegra_drm * tegra = drm -> dev_private ;
564
564
struct tegra_display_hub * hub = tegra -> hub ;
565
- /* planes can be assigned to arbitrary CRTCs */
566
- unsigned int possible_crtcs = 0x7 ;
567
565
struct tegra_shared_plane * plane ;
566
+ unsigned int possible_crtcs ;
568
567
unsigned int num_formats ;
569
568
const u64 * modifiers ;
570
569
struct drm_plane * p ;
@@ -583,6 +582,9 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
583
582
584
583
p = & plane -> base .base ;
585
584
585
+ /* planes can be assigned to arbitrary CRTCs */
586
+ possible_crtcs = BIT (tegra -> num_crtcs ) - 1 ;
587
+
586
588
num_formats = ARRAY_SIZE (tegra_shared_plane_formats );
587
589
formats = tegra_shared_plane_formats ;
588
590
modifiers = tegra_shared_plane_modifiers ;
You can’t perform that action at this time.
0 commit comments