@@ -59,6 +59,7 @@ DCP_THUNK_OUT(iomfb_a358_vi_set_temperature_hint, iomfbep_a358_vi_set_temperatur
5959IOMFB_THUNK_INOUT (set_matrix );
6060IOMFB_THUNK_INOUT (get_color_remap_mode );
6161IOMFB_THUNK_INOUT (last_client_close );
62+ IOMFB_THUNK_INOUT (abort_swaps_dcp );
6263
6364DCP_THUNK_INOUT (dcp_swap_submit , dcpep_swap_submit ,
6465 struct DCP_FW_NAME (dcp_swap_submit_req ),
@@ -859,10 +860,21 @@ static void last_client_closed_poff(struct apple_dcp *dcp, void *out, void *cook
859860 cookie );
860861}
861862
863+ static void aborted_swaps_dcp_poff (struct apple_dcp * dcp , void * out , void * cookie )
864+ {
865+ struct iomfb_last_client_close_req last_client_req = {};
866+ iomfb_last_client_close (dcp , false, & last_client_req ,
867+ last_client_closed_poff , cookie );
868+ }
869+
862870void DCP_FW_NAME (iomfb_poweroff )(struct apple_dcp * dcp )
863871{
864872 int ret , swap_id ;
865- struct iomfb_last_client_close_req last_client_req = {};
873+ struct iomfb_abort_swaps_dcp_req abort_req = {
874+ .client = {
875+ .flag2 = 1 ,
876+ },
877+ };
866878 struct dcp_swap_cookie * cookie ;
867879 struct dcp_wait_cookie * poff_cookie ;
868880 struct dcp_swap_start_req swap_req = { 0 };
@@ -927,8 +939,8 @@ void DCP_FW_NAME(iomfb_poweroff)(struct apple_dcp *dcp)
927939 /* increase refcount to ensure the receiver has a reference */
928940 kref_get (& poff_cookie -> refcount );
929941
930- iomfb_last_client_close (dcp , false, & last_client_req ,
931- last_client_closed_poff , poff_cookie );
942+ iomfb_abort_swaps_dcp (dcp , false, & abort_req ,
943+ aborted_swaps_dcp_poff , poff_cookie );
932944 ret = wait_for_completion_timeout (& poff_cookie -> done ,
933945 msecs_to_jiffies (1000 ));
934946
@@ -953,10 +965,20 @@ static void last_client_closed_sleep(struct apple_dcp *dcp, void *out, void *coo
953965 dcp_set_power_state (dcp , false, & power_req , complete_set_powerstate , cookie );
954966}
955967
968+ static void aborted_swaps_dcp_sleep (struct apple_dcp * dcp , void * out , void * cookie )
969+ {
970+ struct iomfb_last_client_close_req req = { 0 };
971+ iomfb_last_client_close (dcp , false, & req , last_client_closed_sleep , cookie );
972+ }
973+
956974void DCP_FW_NAME (iomfb_sleep )(struct apple_dcp * dcp )
957975{
958976 int ret ;
959- struct iomfb_last_client_close_req req = {};
977+ struct iomfb_abort_swaps_dcp_req req = {
978+ .client = {
979+ .flag2 = 1 ,
980+ },
981+ };
960982
961983 struct dcp_wait_cookie * cookie ;
962984
@@ -968,7 +990,7 @@ void DCP_FW_NAME(iomfb_sleep)(struct apple_dcp *dcp)
968990 /* increase refcount to ensure the receiver has a reference */
969991 kref_get (& cookie -> refcount );
970992
971- iomfb_last_client_close (dcp , false, & req , last_client_closed_sleep ,
993+ iomfb_abort_swaps_dcp (dcp , false, & req , aborted_swaps_dcp_sleep ,
972994 cookie );
973995 ret = wait_for_completion_timeout (& cookie -> done ,
974996 msecs_to_jiffies (1000 ));
0 commit comments