[PATCH 00/32] drm: Deduplicate fb format information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

This series aims to remove the duplicated format information stored under
drm_framebuffer (depth,bits_per_pixel,pixel_format), and instead we just
use the drm_format_info structure. And we store a pointer to the approriate
drm_format_info under drm_framebuffer so that we don't have to do expensive
linear searches through the big array.

Quite of bit of this was cocci magic, and I've tried to keep the cocci
patches pure of manual tinkering in case someone needs to rerun them.
I had some issues with cocci behaving like an idiot, so I've included
a bunch of hand rolled patches up front to make life easier for it.

I've smoke tested this on i915, and compile tested on everything else
(I hope).

Entire series available here:
git://github.com/vsyrjala/linux.git fb_format_dedup

Cc: Alex Deucher <alexander.deucher@xxxxxxx>
Cc: Alexey Brodkin <abrodkin@xxxxxxxxxxxx>
Cc: Ben Skeggs <bskeggs@xxxxxxxxxx>
Cc: Brian Starkey <brian.starkey@xxxxxxx>
Cc: "Christian König" <christian.koenig@xxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
Cc: Gerd Hoffmann <kraxel@xxxxxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: linux-graphics-maintainer@xxxxxxxxxx
Cc: Liviu Dudau <liviu.dudau@xxxxxxx>
Cc: Mali DP Maintainers <malidp@xxxxxxxxxxxx>
Cc: Patrik Jakobsson <patrik.r.jakobsson@xxxxxxxxx>
Cc: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
Cc: Sinclair Yeh <syeh@xxxxxxxxxx>
Cc: Thomas Hellstrom <thellstrom@xxxxxxxxxx>

Ville Syrjälä (32):
  drm/i915: Add local 'fb' variables
  drm/radeon: Add local 'fb' variables
  drm/radeon: Use DIV_ROUND_UP()
  drm/mgag200: Add local 'fb' variable
  drm/ast: Add local 'fb' variables
  drm/gma500: Add some local 'fb' variables
  drm/cirrus: Add some local 'fb' variables
  drm/arcpgu: Add local 'fb' variables
  drm/arm: Add local 'fb' variables
  drm/nouveau: Fix crtc->primary->fb vs. drm_fb fail
  drm/nouveau: Add local 'fb' variables
  drm/vmwgfx: Populate fb->dev before drm_framebuffer_init()
  drm: Pass 'dev' to drm_helper_mode_fill_fb_struct()
  drm/vmwgfx: Populate fb->pixel_format
  drm/qxl: Call drm_helper_mode_fill_fb_struct() before
    drm_framebuffer_init()
  drm/virtio: Call drm_helper_mode_fill_fb_struct() before
    drm_framebuffer_init()
  drm/i915: Set fb->dev early on for inherited fbs
  drm: Populate fb->dev from drm_helper_mode_fill_fb_struct()
  drm: Store a pointer to drm_format_info under drm_framebuffer
  drm/vmwgfx: Populate fb->format correctly
  drm/i915: Populate fb->format early for inherited fbs
  drm/atomic: Replace drm_format_num_planes() with
    fb->format->num_planes
  drm/fb_cma_helper: Replace drm_format_info() with fb->format
  drm/nouveau: Use fb->format rather than drm_format_info()
  drm/i915: Store a pointer to the pixel format info for fbc
  drm/i915: Replace drm_format_plane_cpp() with fb->format->cpp[]
  drm/i915: Replace drm_format_num_planes() with fb->format->num_planes
  drm: Add drm_framebuffer_plane_{width,height}()
  drm/i915: Use drm_framebuffer_plane_{width,height}() where possible
  drm: Nuke fb->depth
  drm: Nuke fb->bits_per_pixel
  drm: Nuke fb->pixel_format

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c     |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c          |  4 +-
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c          |  6 +-
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c          |  6 +-
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c           |  6 +-
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c           |  6 +-
 drivers/gpu/drm/arc/arcpgu_crtc.c               |  3 +-
 drivers/gpu/drm/arm/hdlcd_crtc.c                | 18 +++---
 drivers/gpu/drm/arm/malidp_planes.c             | 10 ++--
 drivers/gpu/drm/armada/armada_crtc.c            |  6 +-
 drivers/gpu/drm/armada/armada_fb.c              |  2 +-
 drivers/gpu/drm/armada/armada_fbdev.c           |  5 +-
 drivers/gpu/drm/armada/armada_overlay.c         |  2 +-
 drivers/gpu/drm/ast/ast_fb.c                    |  4 +-
 drivers/gpu/drm/ast/ast_main.c                  |  2 +-
 drivers/gpu/drm/ast/ast_mode.c                  | 16 +++--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.c |  2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++----
 drivers/gpu/drm/bochs/bochs_fbdev.c             |  2 +-
 drivers/gpu/drm/bochs/bochs_mm.c                |  2 +-
 drivers/gpu/drm/cirrus/cirrus_fbdev.c           |  6 +-
 drivers/gpu/drm/cirrus/cirrus_main.c            |  2 +-
 drivers/gpu/drm/cirrus/cirrus_mode.c            |  9 +--
 drivers/gpu/drm/drm_atomic.c                    |  8 +--
 drivers/gpu/drm/drm_crtc.c                      |  4 +-
 drivers/gpu/drm/drm_crtc_helper.c               |  4 +-
 drivers/gpu/drm/drm_fb_cma_helper.c             | 11 ++--
 drivers/gpu/drm/drm_fb_helper.c                 | 10 ++--
 drivers/gpu/drm/drm_framebuffer.c               | 53 ++++++++++++++++-
 drivers/gpu/drm/drm_modeset_helper.c            | 11 ++--
 drivers/gpu/drm/drm_plane.c                     |  6 +-
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c   |  6 +-
 drivers/gpu/drm/exynos/exynos7_drm_decon.c      |  8 +--
 drivers/gpu/drm/exynos/exynos_drm_fb.c          |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c       |  6 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c        |  4 +-
 drivers/gpu/drm/exynos/exynos_mixer.c           | 12 ++--
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c     |  4 +-
 drivers/gpu/drm/gma500/accel_2d.c               |  2 +-
 drivers/gpu/drm/gma500/framebuffer.c            |  6 +-
 drivers/gpu/drm/gma500/gma_display.c            | 13 +++--
 drivers/gpu/drm/gma500/mdfld_intel_display.c    | 17 +++---
 drivers/gpu/drm/gma500/oaktrail_crtc.c          | 13 +++--
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |  6 +-
 drivers/gpu/drm/i915/i915_debugfs.c             | 11 ++--
 drivers/gpu/drm/i915/i915_drv.h                 |  4 +-
 drivers/gpu/drm/i915/intel_atomic_plane.c       |  4 +-
 drivers/gpu/drm/i915/intel_display.c            | 78 +++++++++++++------------
 drivers/gpu/drm/i915/intel_fbc.c                | 14 ++---
 drivers/gpu/drm/i915/intel_fbdev.c              | 10 ++--
 drivers/gpu/drm/i915/intel_overlay.c            | 26 ++++-----
 drivers/gpu/drm/i915/intel_pm.c                 | 52 ++++++++---------
 drivers/gpu/drm/i915/intel_sprite.c             | 14 ++---
 drivers/gpu/drm/imx/ipuv3-plane.c               | 40 ++++++-------
 drivers/gpu/drm/mediatek/mtk_drm_fb.c           |  2 +-
 drivers/gpu/drm/mediatek/mtk_drm_plane.c        |  2 +-
 drivers/gpu/drm/mgag200/mgag200_fb.c            |  4 +-
 drivers/gpu/drm/mgag200/mgag200_main.c          |  2 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c          | 23 ++++----
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c       |  2 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c       |  4 +-
 drivers/gpu/drm/msm/msm_fb.c                    | 12 ++--
 drivers/gpu/drm/msm/msm_fbdev.c                 |  2 +-
 drivers/gpu/drm/nouveau/dispnv04/crtc.c         | 17 +++---
 drivers/gpu/drm/nouveau/dispnv04/dfp.c          |  3 +-
 drivers/gpu/drm/nouveau/dispnv04/overlay.c      |  8 +--
 drivers/gpu/drm/nouveau/nouveau_display.c       |  4 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c         |  3 +-
 drivers/gpu/drm/nouveau/nv50_display.c          | 14 ++---
 drivers/gpu/drm/omapdrm/omap_fb.c               | 12 ++--
 drivers/gpu/drm/omapdrm/omap_fbdev.c            |  2 +-
 drivers/gpu/drm/qxl/qxl_display.c               |  2 +-
 drivers/gpu/drm/qxl/qxl_draw.c                  |  2 +-
 drivers/gpu/drm/qxl/qxl_fb.c                    |  5 +-
 drivers/gpu/drm/radeon/atombios_crtc.c          | 19 +++---
 drivers/gpu/drm/radeon/r100.c                   | 10 +++-
 drivers/gpu/drm/radeon/radeon_display.c         |  8 +--
 drivers/gpu/drm/radeon/radeon_fb.c              |  4 +-
 drivers/gpu/drm/radeon/radeon_legacy_crtc.c     | 16 ++---
 drivers/gpu/drm/rcar-du/rcar_du_plane.c         |  4 +-
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c           |  4 +-
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c      |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c   |  5 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c     | 22 +++----
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c       |  6 +-
 drivers/gpu/drm/shmobile/shmob_drm_plane.c      |  4 +-
 drivers/gpu/drm/sti/sti_gdp.c                   | 10 ++--
 drivers/gpu/drm/sti/sti_hqvdp.c                 |  2 +-
 drivers/gpu/drm/sun4i/sun4i_backend.c           |  5 +-
 drivers/gpu/drm/tegra/dc.c                      |  8 +--
 drivers/gpu/drm/tegra/drm.c                     |  5 +-
 drivers/gpu/drm/tegra/fb.c                      |  6 +-
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c            |  4 +-
 drivers/gpu/drm/tilcdc/tilcdc_plane.c           |  4 +-
 drivers/gpu/drm/udl/udl_fb.c                    |  6 +-
 drivers/gpu/drm/vc4/vc4_plane.c                 |  6 +-
 drivers/gpu/drm/virtio/virtgpu_display.c        |  3 +-
 drivers/gpu/drm/virtio/virtgpu_fb.c             |  4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c              | 13 +++--
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c             | 29 +++++++--
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c             |  5 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c            |  4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c            |  2 +-
 drivers/gpu/drm/zte/zx_plane.c                  |  2 +-
 include/drm/drm_framebuffer.h                   | 27 ++++-----
 include/drm/drm_modeset_helper.h                |  3 +-
 106 files changed, 532 insertions(+), 447 deletions(-)

-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux