[Intel-gfx] [PATCH] drm/i915: inline skl_copy_ddb_for_pipe() to its only caller
Paulo Zanoni
paulo.r.zanoni at intel.com
Thu Jul 12 21:33:51 UTC 2018
Em Sex, 2018-06-08 às 00:49 +0100, Chris Wilson escreveu:
> Quoting Paulo Zanoni (2018-06-08 00:07:00)
> > static void
> > skl_print_wm_changes(const struct drm_atomic_state *state)
> > {
> > @@ -5381,7 +5370,10 @@ static void skl_initial_wm(struct
> > intel_atomic_state *state,
> > if (cstate->base.active_changed)
> > skl_atomic_update_crtc_wm(state, cstate);
> >
> > - skl_copy_ddb_for_pipe(hw_vals, results, pipe);
> > + memcpy(hw_vals->ddb.uv_plane[pipe], results-
> > >ddb.uv_plane[pipe],
> > + sizeof(hw_vals->ddb.uv_plane[pipe]));
>
> I must be seeing things.
>
> ddb.uv_plane[pipe] must be a pointer, right?
No, it's an array of structs.
> Therefore sizeof(ddb.uv_plane[pipe]) must the size of that pointer
> and
> not of the struct.
It is the size of the array, which is 20 (both before and after the
patch). Each member has size 4.
> Do you not mean sizeof(*ddb.uv_plane[pipe]) ?
What's written above means "size of the first element of
ddb.uv_plane[pipe]". This sizeof operation returns 4 instead of 20. We
don't want to copy just the first element of uv_plane[pipe].
>
> Definitely time to stop reading code...
> -Chris
More information about the Intel-gfx
mailing list