Skip to content

Commit 2d017fe

Browse files
committed
drm/i915: Relocate intel_{rotation,remapped}_info_size()
Move intel_{rotation,remapped}_info_size() into intel_fb.c as that seems a slightly better place than intel_display.c. I suppose these should live somewhere outside the display code as they are also used by the gem code. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
1 parent f04fb40 commit 2d017fe

File tree

5 files changed

+42
-41
lines changed

5 files changed

+42
-41
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -600,42 +600,6 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
600600
intel_wait_for_pipe_off(old_crtc_state);
601601
}
602602

603-
unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info)
604-
{
605-
unsigned int size = 0;
606-
int i;
607-
608-
for (i = 0 ; i < ARRAY_SIZE(rot_info->plane); i++)
609-
size += rot_info->plane[i].dst_stride * rot_info->plane[i].width;
610-
611-
return size;
612-
}
613-
614-
unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info)
615-
{
616-
unsigned int size = 0;
617-
int i;
618-
619-
for (i = 0 ; i < ARRAY_SIZE(rem_info->plane); i++) {
620-
unsigned int plane_size;
621-
622-
if (rem_info->plane[i].linear)
623-
plane_size = rem_info->plane[i].size;
624-
else
625-
plane_size = rem_info->plane[i].dst_stride * rem_info->plane[i].height;
626-
627-
if (plane_size == 0)
628-
continue;
629-
630-
if (rem_info->plane_alignment)
631-
size = ALIGN(size, rem_info->plane_alignment);
632-
633-
size += plane_size;
634-
}
635-
636-
return size;
637-
}
638-
639603
/*
640604
* Convert the x/y offsets into a linear offset.
641605
* Only valid with 0/180 degree rotation, which is fine since linear

drivers/gpu/drm/i915/display/intel_display.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ struct intel_link_m_n;
5959
struct intel_plane;
6060
struct intel_plane_state;
6161
struct intel_power_domain_mask;
62-
struct intel_remapped_info;
63-
struct intel_rotation_info;
6462
struct pci_dev;
6563
struct work_struct;
6664

@@ -465,8 +463,6 @@ unsigned int intel_fb_xy_to_linear(int x, int y,
465463
int plane);
466464
void intel_add_fb_offsets(int *x, int *y,
467465
const struct intel_plane_state *state, int plane);
468-
unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info);
469-
unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info);
470466
bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv);
471467
void intel_encoder_destroy(struct drm_encoder *encoder);
472468
struct drm_display_mode *

drivers/gpu/drm/i915/display/intel_fb.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,42 @@ static void intel_plane_remap_gtt(struct intel_plane_state *plane_state)
18911891
}
18921892
}
18931893

1894+
unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info)
1895+
{
1896+
unsigned int size = 0;
1897+
int i;
1898+
1899+
for (i = 0 ; i < ARRAY_SIZE(rot_info->plane); i++)
1900+
size += rot_info->plane[i].dst_stride * rot_info->plane[i].width;
1901+
1902+
return size;
1903+
}
1904+
1905+
unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info)
1906+
{
1907+
unsigned int size = 0;
1908+
int i;
1909+
1910+
for (i = 0 ; i < ARRAY_SIZE(rem_info->plane); i++) {
1911+
unsigned int plane_size;
1912+
1913+
if (rem_info->plane[i].linear)
1914+
plane_size = rem_info->plane[i].size;
1915+
else
1916+
plane_size = rem_info->plane[i].dst_stride * rem_info->plane[i].height;
1917+
1918+
if (plane_size == 0)
1919+
continue;
1920+
1921+
if (rem_info->plane_alignment)
1922+
size = ALIGN(size, rem_info->plane_alignment);
1923+
1924+
size += plane_size;
1925+
}
1926+
1927+
return size;
1928+
}
1929+
18941930
void intel_fb_fill_view(const struct intel_framebuffer *fb, unsigned int rotation,
18951931
struct intel_fb_view *view)
18961932
{

drivers/gpu/drm/i915/display/intel_fb.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ struct intel_fb_view;
1919
struct intel_framebuffer;
2020
struct intel_plane;
2121
struct intel_plane_state;
22+
struct intel_remapped_info;
23+
struct intel_rotation_info;
2224

2325
#define INTEL_PLANE_CAP_NONE 0
2426
#define INTEL_PLANE_CAP_CCS_RC BIT(0)
@@ -80,6 +82,9 @@ bool intel_fb_needs_pot_stride_remap(const struct intel_framebuffer *fb);
8082
bool intel_plane_uses_fence(const struct intel_plane_state *plane_state);
8183
bool intel_fb_supports_90_270_rotation(const struct intel_framebuffer *fb);
8284

85+
unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info);
86+
unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info);
87+
8388
int intel_fill_fb_info(struct intel_display *display, struct intel_framebuffer *fb);
8489
void intel_fb_fill_view(const struct intel_framebuffer *fb, unsigned int rotation,
8590
struct intel_fb_view *view);

drivers/gpu/drm/i915/i915_vma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <linux/dma-fence-array.h>
2727
#include <drm/drm_gem.h>
2828

29-
#include "display/intel_display.h"
29+
#include "display/intel_fb.h"
3030
#include "display/intel_frontbuffer.h"
3131
#include "gem/i915_gem_lmem.h"
3232
#include "gem/i915_gem_object_frontbuffer.h"

0 commit comments

Comments
 (0)