tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel 
chromeos-4.14
head:   8bc9327f8f516fbb2758ae854bf36891a2a11d5b
commit: 755b54624d46767dfa04279fb6e582e55de0b69d [427/565] UPSTREAM: 
drm/amd/display: Move lock to front end program.

smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2566 
dcn10_apply_ctx_for_surface() error: we previously assumed 
'pipe_ctx->stream_res.tg' could be null (see line 2555)

git remote add chrome-os 
https://chromium.googlesource.com/chromiumos/third_party/kernel
git remote update chrome-os
git checkout 755b54624d46767dfa04279fb6e582e55de0b69d
vim +2566 drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c

d153a3fac Hersen Wu          2017-09-05  2511  
16f3a1304 Harry Wentland     2017-05-08  2512  static void 
dcn10_apply_ctx_for_surface(
8f277dfee Bhawanpreet Lakha  2017-08-01  2513           struct dc *dc,
fa047f36f Eric Yang          2017-08-03  2514           const struct 
dc_stream_state *stream,
fa047f36f Eric Yang          2017-08-03  2515           int num_planes,
d7da90ca5 Jerry Zuo          2017-08-25  2516           struct dc_state 
*context)
16f3a1304 Harry Wentland     2017-05-08  2517  {
d5a30d9b3 Tony Cheng         2017-07-19  2518   int i, be_idx;
16f3a1304 Harry Wentland     2017-05-08  2519  
8f277dfee Bhawanpreet Lakha  2017-08-01  2520   if (dc->debug.sanity_checks)
644918427 Tony Cheng         2017-07-14  2521           
verify_allow_pstate_change_high(dc->hwseq);
644918427 Tony Cheng         2017-07-14  2522  
fa047f36f Eric Yang          2017-08-03  2523   be_idx = -1;
fa047f36f Eric Yang          2017-08-03  2524   for (i = 0; i < 
dc->res_pool->pipe_count; i++) {
fa047f36f Eric Yang          2017-08-03  2525           if (stream == 
context->res_ctx.pipe_ctx[i].stream) {
fa047f36f Eric Yang          2017-08-03  2526                   be_idx = 
context->res_ctx.pipe_ctx[i].stream_res.tg->inst;
d5a30d9b3 Tony Cheng         2017-07-19  2527                   break;
fa047f36f Eric Yang          2017-08-03  2528           }
fa047f36f Eric Yang          2017-08-03  2529   }
fa047f36f Eric Yang          2017-08-03  2530  
fa047f36f Eric Yang          2017-08-03  2531   ASSERT(be_idx != -1);
fa047f36f Eric Yang          2017-08-03  2532  
fa047f36f Eric Yang          2017-08-03  2533   if (num_planes == 0) {
fa047f36f Eric Yang          2017-08-03  2534           for (i = 
dc->res_pool->pipe_count - 1; i >= 0 ; i--) {
fa047f36f Eric Yang          2017-08-03  2535                   struct pipe_ctx 
*old_pipe_ctx =
d7da90ca5 Jerry Zuo          2017-08-25  2536                                   
                &dc->current_state->res_ctx.pipe_ctx[i];
fa047f36f Eric Yang          2017-08-03  2537  
59550b34a Yongqiang Sun      2017-08-11  2538                   if 
(old_pipe_ctx->stream_res.tg && old_pipe_ctx->stream_res.tg->inst == be_idx) {
59550b34a Yongqiang Sun      2017-08-11  2539                           
old_pipe_ctx->stream_res.tg->funcs->set_blank(old_pipe_ctx->stream_res.tg, 
true);
fa047f36f Eric Yang          2017-08-03  2540                           
dcn10_power_down_fe(dc, old_pipe_ctx->pipe_idx);
fa047f36f Eric Yang          2017-08-03  2541                   }
59550b34a Yongqiang Sun      2017-08-11  2542           }
fa047f36f Eric Yang          2017-08-03  2543           return;
fa047f36f Eric Yang          2017-08-03  2544   }
d5a30d9b3 Tony Cheng         2017-07-19  2545  
0e8c56620 Dmytro Laktyushkin 2017-06-14  2546   /* reset unused mpcc */
f89655d01 Eric Yang          2017-07-12  2547   for (i = 0; i < 
dc->res_pool->pipe_count; i++) {
0e8c56620 Dmytro Laktyushkin 2017-06-14  2548           struct pipe_ctx 
*pipe_ctx = &context->res_ctx.pipe_ctx[i];
0e8c56620 Dmytro Laktyushkin 2017-06-14  2549           struct pipe_ctx 
*old_pipe_ctx =
d7da90ca5 Jerry Zuo          2017-08-25  2550                           
&dc->current_state->res_ctx.pipe_ctx[i];
d5a30d9b3 Tony Cheng         2017-07-19  2551  
f56f75dba Harry Wentland     2017-07-27  2552           if 
(!pipe_ctx->plane_state && !old_pipe_ctx->plane_state)
d5a30d9b3 Tony Cheng         2017-07-19  2553                   continue;
d5a30d9b3 Tony Cheng         2017-07-19  2554  
755b54624 Yongqiang Sun      2017-10-17 @2555           if 
(pipe_ctx->stream_res.tg &&
                                                            
^^^^^^^^^^^^^^^^^^^^^^^
Checked

755b54624 Yongqiang Sun      2017-10-17  2556                   
pipe_ctx->stream_res.tg->inst == be_idx &&
755b54624 Yongqiang Sun      2017-10-17  2557                   
!pipe_ctx->top_pipe)
755b54624 Yongqiang Sun      2017-10-17  2558                   
pipe_ctx->stream_res.tg->funcs->lock(pipe_ctx->stream_res.tg);
755b54624 Yongqiang Sun      2017-10-17  2559  
a5f770815 Eric Yang          2017-07-18  2560           /*
a5f770815 Eric Yang          2017-07-18  2561            * Powergate reused 
pipes that are not powergated
a5f770815 Eric Yang          2017-07-18  2562            * fairly hacky right 
now, using opp_id as indicator
a5f770815 Eric Yang          2017-07-18  2563            */
d5a30d9b3 Tony Cheng         2017-07-19  2564  
f56f75dba Harry Wentland     2017-07-27  2565           if 
(pipe_ctx->plane_state && !old_pipe_ctx->plane_state) {
85fb3d952 Yue Hin Lau        2017-10-02 @2566                   if 
(pipe_ctx->plane_res.hubp->opp_id != 0xf && pipe_ctx->stream_res.tg->inst == 
be_idx) {
                                                                                
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unchecked dereference.

a5f770815 Eric Yang          2017-07-18  2567                           
dcn10_power_down_fe(dc, pipe_ctx->pipe_idx);
90d45c25e Eric Yang          2017-07-20  2568                           /*
90d45c25e Eric Yang          2017-07-20  2569                            * 
power down fe will unlock when calling reset, need
90d45c25e Eric Yang          2017-07-20  2570                            * to 
lock it back here. Messy, need rework.
90d45c25e Eric Yang          2017-07-20  2571                            */
829e0fe85 Harry Wentland     2017-07-30  2572                           
pipe_ctx->stream_res.tg->funcs->lock(pipe_ctx->stream_res.tg);
90d45c25e Eric Yang          2017-07-20  2573                   }
a5f770815 Eric Yang          2017-07-18  2574           }
0e8c56620 Dmytro Laktyushkin 2017-06-14  2575  
d5a30d9b3 Tony Cheng         2017-07-19  2576  
f56f75dba Harry Wentland     2017-07-27  2577           if 
((!pipe_ctx->plane_state && old_pipe_ctx->plane_state)
0e8c56620 Dmytro Laktyushkin 2017-06-14  2578                           || 
(!pipe_ctx->stream && old_pipe_ctx->stream)) {
829e0fe85 Harry Wentland     2017-07-30  2579                   if 
(old_pipe_ctx->stream_res.tg->inst != be_idx)
d5a30d9b3 Tony Cheng         2017-07-19  2580                           
continue;
d5a30d9b3 Tony Cheng         2017-07-19  2581  
f89655d01 Eric Yang          2017-07-12  2582                   if 
(!old_pipe_ctx->top_pipe) {
f89655d01 Eric Yang          2017-07-12  2583                           
ASSERT(0);
f89655d01 Eric Yang          2017-07-12  2584                           
continue;
f89655d01 Eric Yang          2017-07-12  2585                   }
f89655d01 Eric Yang          2017-07-12  2586  
a5f770815 Eric Yang          2017-07-18  2587                   /* reset mpc */
c06908949 Dmytro Laktyushkin 2017-07-21  2588                   
dc->res_pool->mpc->funcs->remove(
c06908949 Dmytro Laktyushkin 2017-07-21  2589                                   
dc->res_pool->mpc,
cce186629 Eric Bernstein     2017-09-11  2590                                   
&(old_pipe_ctx->stream_res.opp->mpc_tree),
cce186629 Eric Bernstein     2017-09-11  2591                                   
old_pipe_ctx->stream_res.opp->inst,
c06908949 Dmytro Laktyushkin 2017-07-21  2592                                   
old_pipe_ctx->pipe_idx);
85fb3d952 Yue Hin Lau        2017-10-02  2593                   
old_pipe_ctx->stream_res.opp->mpcc_disconnect_pending[old_pipe_ctx->plane_res.hubp->mpcc_id]
 = true;
644918427 Tony Cheng         2017-07-14  2594  
cedf5da6d Eric Yang          2017-07-24  2595                   
/*dm_logger_write(dc->ctx->logger, LOG_ERROR,
cedf5da6d Eric Yang          2017-07-24  2596                                   
"[debug_mpo: apply_ctx disconnect pending on mpcc %d]\n",
cedf5da6d Eric Yang          2017-07-24  2597                                   
old_pipe_ctx->mpcc->inst);*/
cedf5da6d Eric Yang          2017-07-24  2598  
8f277dfee Bhawanpreet Lakha  2017-08-01  2599                   if 
(dc->debug.sanity_checks)
644918427 Tony Cheng         2017-07-14  2600                           
verify_allow_pstate_change_high(dc->hwseq);
644918427 Tony Cheng         2017-07-14  2601  
0e8c56620 Dmytro Laktyushkin 2017-06-14  2602                   
old_pipe_ctx->top_pipe = NULL;
0e8c56620 Dmytro Laktyushkin 2017-06-14  2603                   
old_pipe_ctx->bottom_pipe = NULL;
f56f75dba Harry Wentland     2017-07-27  2604                   
old_pipe_ctx->plane_state = NULL;
0695a4a05 Yongqiang Sun      2017-09-28  2605                   
old_pipe_ctx->stream = NULL;
0e8c56620 Dmytro Laktyushkin 2017-06-14  2606  
0e8c56620 Dmytro Laktyushkin 2017-06-14  2607                   
dm_logger_write(dc->ctx->logger, LOG_DC,
0e8c56620 Dmytro Laktyushkin 2017-06-14  2608                                   
"Reset mpcc for pipe %d\n",
0e8c56620 Dmytro Laktyushkin 2017-06-14  2609                                   
old_pipe_ctx->pipe_idx);
0e8c56620 Dmytro Laktyushkin 2017-06-14  2610           }
f89655d01 Eric Yang          2017-07-12  2611   }
0e8c56620 Dmytro Laktyushkin 2017-06-14  2612  
16f3a1304 Harry Wentland     2017-05-08  2613   for (i = 0; i < 
dc->res_pool->pipe_count; i++) {
16f3a1304 Harry Wentland     2017-05-08  2614           struct pipe_ctx 
*pipe_ctx = &context->res_ctx.pipe_ctx[i];
755b54624 Yongqiang Sun      2017-10-17  2615           struct pipe_ctx 
*old_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
16f3a1304 Harry Wentland     2017-05-08  2616  
fa047f36f Eric Yang          2017-08-03  2617           if (pipe_ctx->stream != 
stream)
16f3a1304 Harry Wentland     2017-05-08  2618                   continue;
16f3a1304 Harry Wentland     2017-05-08  2619  
16f3a1304 Harry Wentland     2017-05-08  2620           /* looking for top pipe 
to program */
755b54624 Yongqiang Sun      2017-10-17  2621           if 
(!pipe_ctx->top_pipe) {
16f3a1304 Harry Wentland     2017-05-08  2622                   
program_all_pipe_in_tree(dc, pipe_ctx, context);
755b54624 Yongqiang Sun      2017-10-17  2623                   if 
(pipe_ctx->stream_res.tg &&
755b54624 Yongqiang Sun      2017-10-17  2624                           
pipe_ctx->stream_res.tg->inst == be_idx &&
755b54624 Yongqiang Sun      2017-10-17  2625                           
(pipe_ctx->plane_state || old_pipe_ctx->plane_state))
755b54624 Yongqiang Sun      2017-10-17  2626                           
pipe_ctx->stream_res.tg->funcs->unlock(pipe_ctx->stream_res.tg);
755b54624 Yongqiang Sun      2017-10-17  2627           }
16f3a1304 Harry Wentland     2017-05-08  2628   }
16f3a1304 Harry Wentland     2017-05-08  2629  
95518f202 Dmytro Laktyushkin 2017-06-07  2630   
dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
95518f202 Dmytro Laktyushkin 2017-06-07  2631                   
"\n============== Watermark parameters ==============\n"
95518f202 Dmytro Laktyushkin 2017-06-07  2632                   "a.urgent_ns: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2633                   
"a.cstate_enter_plus_exit: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2634                   "a.cstate_exit: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2635                   
"a.pstate_change: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2636                   
"a.pte_meta_urgent: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2637                   "b.urgent_ns: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2638                   
"b.cstate_enter_plus_exit: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2639                   "b.cstate_exit: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2640                   
"b.pstate_change: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2641                   
"b.pte_meta_urgent: %d \n",
95518f202 Dmytro Laktyushkin 2017-06-07  2642                   
context->bw.dcn.watermarks.a.urgent_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2643                   
context->bw.dcn.watermarks.a.cstate_pstate.cstate_enter_plus_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2644                   
context->bw.dcn.watermarks.a.cstate_pstate.cstate_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2645                   
context->bw.dcn.watermarks.a.cstate_pstate.pstate_change_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2646                   
context->bw.dcn.watermarks.a.pte_meta_urgent_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2647                   
context->bw.dcn.watermarks.b.urgent_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2648                   
context->bw.dcn.watermarks.b.cstate_pstate.cstate_enter_plus_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2649                   
context->bw.dcn.watermarks.b.cstate_pstate.cstate_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2650                   
context->bw.dcn.watermarks.b.cstate_pstate.pstate_change_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2651                   
context->bw.dcn.watermarks.b.pte_meta_urgent_ns
95518f202 Dmytro Laktyushkin 2017-06-07  2652                   );
95518f202 Dmytro Laktyushkin 2017-06-07  2653   
dm_logger_write(dc->ctx->logger, LOG_BANDWIDTH_CALCS,
95518f202 Dmytro Laktyushkin 2017-06-07  2654                   "\nc.urgent_ns: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2655                   
"c.cstate_enter_plus_exit: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2656                   "c.cstate_exit: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2657                   
"c.pstate_change: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2658                   
"c.pte_meta_urgent: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2659                   "d.urgent_ns: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2660                   
"d.cstate_enter_plus_exit: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2661                   "d.cstate_exit: 
%d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2662                   
"d.pstate_change: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2663                   
"d.pte_meta_urgent: %d \n"
95518f202 Dmytro Laktyushkin 2017-06-07  2664                   
"========================================================\n",
95518f202 Dmytro Laktyushkin 2017-06-07  2665                   
context->bw.dcn.watermarks.c.urgent_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2666                   
context->bw.dcn.watermarks.c.cstate_pstate.cstate_enter_plus_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2667                   
context->bw.dcn.watermarks.c.cstate_pstate.cstate_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2668                   
context->bw.dcn.watermarks.c.cstate_pstate.pstate_change_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2669                   
context->bw.dcn.watermarks.c.pte_meta_urgent_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2670                   
context->bw.dcn.watermarks.d.urgent_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2671                   
context->bw.dcn.watermarks.d.cstate_pstate.cstate_enter_plus_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2672                   
context->bw.dcn.watermarks.d.cstate_pstate.cstate_exit_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2673                   
context->bw.dcn.watermarks.d.cstate_pstate.pstate_change_ns,
95518f202 Dmytro Laktyushkin 2017-06-07  2674                   
context->bw.dcn.watermarks.d.pte_meta_urgent_ns
95518f202 Dmytro Laktyushkin 2017-06-07  2675                   );
644918427 Tony Cheng         2017-07-14  2676  
8f277dfee Bhawanpreet Lakha  2017-08-01  2677   if (dc->debug.sanity_checks)
644918427 Tony Cheng         2017-07-14  2678           
verify_allow_pstate_change_high(dc->hwseq);
16f3a1304 Harry Wentland     2017-05-08  2679  }
16f3a1304 Harry Wentland     2017-05-08  2680  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

Reply via email to