OSDN Git Service

drm/i915/intel_fb: Factor out calc_plane_normal_size()
authorImre Deak <imre.deak@intel.com>
Thu, 25 Mar 2021 21:47:58 +0000 (23:47 +0200)
committerImre Deak <imre.deak@intel.com>
Mon, 29 Mar 2021 19:58:03 +0000 (22:58 +0300)
commit5d32bcd0a74c791c7049817d42dd3645d6c63faf
tree22101bc6dd9bd536d4abdd03989c255069437905
parent435b3e7ed708715b048ec5d08edcec4876e3eb57
drm/i915/intel_fb: Factor out calc_plane_normal_size()

Factor out to a new function the logic to calculate an FB plane's
normal-view size.

Instead of using intel_remapped_plane_info, which is related only to
remapping, add a helper to get the tile pitch and rows for an FB plane,
so these helpers can be used both by the normal size calculation and the
remapping code.

Also add a new fb_plane_view_dims struct in which we can pass around the
view (either FB plane or plane source) and tile dimensions conveniently
to functions calculating further view parameters.

v2:
- Add back the +1 tile adjustment for x!=0 in calc_plane_normal_size(). (Ville)
- s/pages/tiles/ in calc_plane_normal_size(). (Ville)
- Add a helper for the plane view width calculation. (Ville)
- Return tiles as unsigned int from calc_plane_normal_size().

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210325214808.2071517-16-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_fb.c