68
68
/* readahead for partial-frame prefetch */
69
69
#define MALIDP_MMU_PREFETCH_READAHEAD 8
70
70
71
- static void malidp_de_plane_destroy (struct drm_plane * plane )
72
- {
73
- struct malidp_plane * mp = to_malidp_plane (plane );
74
-
75
- drm_plane_cleanup (plane );
76
- kfree (mp );
77
- }
78
-
79
71
/*
80
72
* Replicate what the default ->reset hook does: free the state pointer and
81
73
* allocate a new empty object. We just need enough space to store
@@ -260,7 +252,6 @@ static bool malidp_format_mod_supported_per_plane(struct drm_plane *plane,
260
252
static const struct drm_plane_funcs malidp_de_plane_funcs = {
261
253
.update_plane = drm_atomic_helper_update_plane ,
262
254
.disable_plane = drm_atomic_helper_disable_plane ,
263
- .destroy = malidp_de_plane_destroy ,
264
255
.reset = malidp_plane_reset ,
265
256
.atomic_duplicate_state = malidp_duplicate_plane_state ,
266
257
.atomic_destroy_state = malidp_destroy_plane_state ,
@@ -972,12 +963,6 @@ int malidp_de_planes_init(struct drm_device *drm)
972
963
for (i = 0 ; i < map -> n_layers ; i ++ ) {
973
964
u8 id = map -> layers [i ].id ;
974
965
975
- plane = kzalloc (sizeof (* plane ), GFP_KERNEL );
976
- if (!plane ) {
977
- ret = - ENOMEM ;
978
- goto cleanup ;
979
- }
980
-
981
966
/* build the list of DRM supported formats based on the map */
982
967
for (n = 0 , j = 0 ; j < map -> n_pixel_formats ; j ++ ) {
983
968
if ((map -> pixel_formats [j ].layer & id ) == id )
@@ -990,13 +975,14 @@ int malidp_de_planes_init(struct drm_device *drm)
990
975
/*
991
976
* All the layers except smart layer supports AFBC modifiers.
992
977
*/
993
- ret = drm_universal_plane_init (drm , & plane -> base , crtcs ,
994
- & malidp_de_plane_funcs , formats , n ,
995
- (id == DE_SMART ) ? linear_only_modifiers : modifiers ,
996
- plane_type , NULL );
997
-
998
- if ( ret < 0 )
978
+ plane = drmm_universal_plane_alloc (drm , struct malidp_plane , base ,
979
+ crtcs , & malidp_de_plane_funcs , formats , n ,
980
+ (id == DE_SMART ) ? linear_only_modifiers :
981
+ modifiers , plane_type , NULL );
982
+ if ( IS_ERR ( plane )) {
983
+ ret = PTR_ERR ( plane );
999
984
goto cleanup ;
985
+ }
1000
986
1001
987
drm_plane_helper_add (& plane -> base ,
1002
988
& malidp_de_plane_helper_funcs );
0 commit comments