All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
To: dri-devel@lists.freedesktop.org
Cc: Ayan Halder <Ayan.Halder@arm.com>,
	kernel@collabora.com, Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Sandy Huang <hjc@rock-chips.com>,
	James Wang <james.qian.wang@arm.com>,
	Mihail Atanassov <mihail.atanassov@arm.com>
Subject: [PATCHv7 0/6] Add AFBC support for Rockchip
Date: Wed, 11 Mar 2020 15:55:35 +0100	[thread overview]
Message-ID: <20200311145541.29186-1-andrzej.p@collabora.com> (raw)

This series adds AFBC support for Rockchip. It is inspired by:

https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/factory-gru-9017.B-chromeos-4.4/drivers/gpu/drm/rockchip/rockchip_drm_vop.c

This is the seventh iteration of the afbc series, which addresses
comments received for v6.

Compared to v5 it simplifies the way afbc-related helpers are
exposed to their users.

A new struct drm_afbc_framebuffer is added, which stores afbc-related
driver-specific data. Interested drivers need to explicitly allocate
an instance of struct drm_afbc_framebuffer, use drm_gem_fb_init_with_funcs()
call drm_gem_fb_afbc_init() and do their specific afbc-related checks.

There are 3 interested drivers: malidp, komeda and rockchip and I only have
rockchip hardware. As Liviu reports, due to the coronavirus outbreak,
it is difficult to test komeda now, so, according to his suggestion,
I purposedly omit changes to komeda. Malidp is changed accordingly, though,
which is a proof that it can be done. Then adding afbc support for rockchip
follows the malidp example.

I kindly ask for reviewing the series. I need to mention that my ultimate
goal is merging afbc for rockchip and I don't have other hardware, so some
help from malidp developers/maintainers would be appreciated.

Rebased onto drm-misc-next.

v6..v7:
- used IS_ERR() instead of IS_ERR_OR_NULL() (Emil)
- made drm_gem_fb_afbc_init() symmetric in terms of not putting the objects
in case of error, it is now caller's responsibility (Emil)
- added an entry in Documentation/gpu/todo.rst about drivers not encoding
cpp in their format info (Emil)
- sticked to the 80 columns per line rule wherever possible, excluding
error messages so that they can be grepped (Emil)
- removed redundant WARN_ON() in rockchip_mod_supported() (Emil)
- made drm_gem_fb_init() and drm_gem_fb_init_with_funcs() return an int (James)
- factored in drm_afbc_get_superblock_wh() (James)
- eliminated unknown types error for u32/u64 (kbuild)

v5..v6:
- reworked the way afbc-specific helpers are exposed to drivers (Daniel)
- not checking block size mask in drm_is_afbc (James)
- fixed the test for afbc format (Boris)
- documented unused afbc format modifier values in drm_afbc_get_superblock_wh()
(Boris)
- changed drm_is_afbc to a macro
- renamed drm_gem_fb_lookup() to drm_gem_fb_objs_lookup() (James)
- eliminated storing block/tile alignment constraint in
 struct drm_afbc_framebuffer (James)
- eliminated storing afbc header alignment constraint
 in struct drm_afbc_framebuffer (James)
- eliminated storing afbc payload's offset in struct
drm_afbc_framebuffer (James)
- moved to taking bpp value from drm_format_info except malidp which doesn't
set it properly (James)
- removed unrelated coding style fixes in rockchip (Boris)
- consolidated 2-line error messages into one-liners in rockchip (Boris)
- added checking that there is at most one AFBC plane in
vop_crtc_atomic_check() (Boris)
- added checking that AFBC format is indeed supported in
rockchip_mod_supported() (Boris)
- removed requirement of exactly one color plane in rockchip_mod_supported()
- removed afbc_win hack in rockchip in favor of adding a field to crtc state
and ensuring only one AFBC plane in crtc's atomic check (Boris)

v4..v5:
- used proper way of subclassing drm_framebuffer (Daniel Vetter)
- added documentation to exported functions (Liviu Dudau)
- reordered new functions in drm_gem_framebuffer_helper.c to make a saner
diff (Liviu Dudau)
- used "2" suffix instead of "_special" for the special version of size
checks (Liviu Dudau)
- dropped unnecessarily added condition in drm_get_format_info() (Liviu
Dudau)
- dropped "block_size = 0;" trick in framebuffer_check() (Daniel Vetter)
- relaxed sticking to 80 characters per line rule in some cases

v3..v4:

- addressed (some) comments from Daniel Stone, Ezequiel Garcia, Daniel
Vetter and James Qian Wang - thank you for input
- refactored helpers to ease accommodating drivers with afbc needs
- moved afbc checks to helpers
- converted komeda, malidp and (the newly added) rockchip to use the afbc
helpers
- eliminated a separate, dedicated source code file

v2..v3:

- addressed (some) comments from Daniel Stone, Liviu Dudau, Daniel Vetter
and Brian Starkey - thank you all

In this iteration some rework has been done. The checking logic is now moved
to framebuffer_check() so it is common to all drivers. But the common part
is not good for komeda, so this series is not good for merging yet.
I kindly ask for feedback whether the changes are in the right direction.
I also kindly ask for input on how to accommodate komeda.

The CONFIG_DRM_AFBC option has been eliminated in favour of adding
drm_afbc.c to drm_kms_helper.

v1..v2:

- addressed comments from Daniel Stone, Ayan Halder, Mihail Atanassov
- coding style fixes

Andrzej Pietrasiewicz (6):
  drm/core: Allow drivers allocate a subclass of struct drm_framebuffer
  drm/core: Add drm_afbc_framebuffer and a corresponding helper
  drm/arm/malidp: Factor-in framebuffer creation
  drm/arm/malidp: Allocate an afbc-specific drm_framebuffer
  drm/arm/malidp: Switch to afbc helpers
  drm/rockchip: Add support for afbc

 Documentation/gpu/todo.rst                   |  15 ++
 drivers/gpu/drm/arm/malidp_drv.c             | 151 ++++++--------
 drivers/gpu/drm/drm_gem_framebuffer_helper.c | 195 ++++++++++++++++---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h  |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c   |  43 +++-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c  | 137 ++++++++++++-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h  |  17 ++
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c  |  83 +++++++-
 include/drm/drm_framebuffer.h                |  45 +++++
 include/drm/drm_gem_framebuffer_helper.h     |  15 ++
 10 files changed, 580 insertions(+), 122 deletions(-)


base-commit: 41252c6d1c3bc640c3283a797400719fbe7dcec1
-- 
2.17.1

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

             reply	other threads:[~2020-03-11 14:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 14:55 Andrzej Pietrasiewicz [this message]
2020-03-11 14:55 ` [PATCHv7 1/6] drm/core: Allow drivers allocate a subclass of struct drm_framebuffer Andrzej Pietrasiewicz
2020-03-17  3:08   ` james qian wang (Arm Technology China)
2020-03-11 14:55 ` [PATCHv7 2/6] drm/core: Add drm_afbc_framebuffer and a corresponding helper Andrzej Pietrasiewicz
2020-03-17  3:15   ` james qian wang (Arm Technology China)
2020-03-17 10:16   ` Daniel Vetter
2020-03-30 17:01   ` Daniel Vetter
2020-03-30 17:44     ` Andrzej Pietrasiewicz
2020-03-30 18:24       ` Daniel Vetter
2020-03-31 15:53         ` [PATCH 0/2] AFBC fixes Andrzej Pietrasiewicz
2020-03-31 15:53           ` [PATCH 1/2] drm/core: Use proper debugging macro Andrzej Pietrasiewicz
2020-04-01  9:13             ` Daniel Vetter
2020-03-31 15:53           ` [PATCH 2/2] drm/core: Calculate bpp in afbc helper Andrzej Pietrasiewicz
2020-04-01  9:13             ` Daniel Vetter
2020-03-11 14:55 ` [PATCHv7 3/6] drm/arm/malidp: Factor-in framebuffer creation Andrzej Pietrasiewicz
2020-03-11 14:55 ` [PATCHv7 4/6] drm/arm/malidp: Allocate an afbc-specific drm_framebuffer Andrzej Pietrasiewicz
2020-03-16 14:05   ` Emil Velikov
2020-03-11 14:55 ` [PATCHv7 5/6] drm/arm/malidp: Switch to afbc helpers Andrzej Pietrasiewicz
2020-03-11 14:55 ` [PATCHv7 6/6] drm/rockchip: Add support for afbc Andrzej Pietrasiewicz
2020-03-16 14:10   ` Emil Velikov
2020-03-19  2:57     ` Sandy Huang
2020-03-19  9:54       ` Andrzej Pietrasiewicz
2020-03-20 11:34         ` Sandy Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311145541.29186-1-andrzej.p@collabora.com \
    --to=andrzej.p@collabora.com \
    --cc=Ayan.Halder@arm.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hjc@rock-chips.com \
    --cc=james.qian.wang@arm.com \
    --cc=kernel@collabora.com \
    --cc=liviu.dudau@arm.com \
    --cc=mihail.atanassov@arm.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.