mbox series

[v6,0/5] Introduce drm scaling filter property

Message ID 20201012184130.937-1-pankaj.laxminarayan.bharadiya@intel.com (mailing list archive)
Headers show
Series Introduce drm scaling filter property | expand

Message

Pankaj Bharadiya Oct. 12, 2020, 6:41 p.m. UTC
Earlier, I kept this series on hold since we wanted to have a
reference userspace implementation in place.

Now, Sameer has implemented Integer scaling in Kodi Retro gaming
framework which demonstrate how Integer scaling gives distinctive
look to pixel art games when played on higher resolution monitors.

Kodi patches are reviewed and accepted for merge now.

Here is the userspace patch series link:
https://github.com/xbmc/xbmc/pull/18194

Background on Integer scaling:

Integer scaling (IS) is a nearest-neighbor upscaling technique that
simply scales up the existing pixels by an integer (i.e., whole
number) multiplier. Nearest-neighbor (NN) interpolation works by
filling in the missing color values in the upscaled image with that of
the coordinate-mapped nearest source pixel value.

Both IS and NN preserve the clarity of the original image. In
contrast, traditional upscaling algorithms, such as bilinear or
bicubic interpolation, result in blurry upscaled images because they
employ interpolation techniques that smooth out the transition from
one pixel to another.  Therefore, integer scaling is particularly
useful for pixel art games that rely on sharp, blocky images to
deliver their distinctive look.

Many gaming communities have been asking for integer-mode scaling
support, some links and background:

https://software.intel.com/en-us/articles/integer-scaling-support-on-intel-graphics
http://tanalin.com/en/articles/lossless-scaling/
https://community.amd.com/thread/209107
https://www.nvidia.com/en-us/geforce/forums/game-ready-drivers/13/1002/feature-request-nonblurry-upscaling-at-integer-rat/

* Changes in v6:
 - Rebase to latest drm-tip
 - Address review comments from Uma

Pankaj Bharadiya (5):
  drm: Introduce plane and CRTC scaling filter properties
  drm/drm-kms.rst: Add plane and CRTC scaling filter property
    documentation
  drm/i915: Introduce scaling filter related registers and bit fields
  drm/i915/display: Add Nearest-neighbor based integer scaling support
  drm/i915: Enable scaling filter for plane and CRTC

 Documentation/gpu/drm-kms.rst                 |  12 ++
 drivers/gpu/drm/drm_atomic_uapi.c             |   8 ++
 drivers/gpu/drm/drm_crtc.c                    |  48 +++++++
 drivers/gpu/drm/drm_crtc_internal.h           |   3 +
 drivers/gpu/drm/drm_plane.c                   |  90 ++++++++++++++
 .../gpu/drm/i915/display/intel_atomic_plane.c |   1 +
 drivers/gpu/drm/i915/display/intel_display.c  | 117 +++++++++++++++++-
 drivers/gpu/drm/i915/display/intel_display.h  |   4 +
 .../drm/i915/display/intel_display_types.h    |   2 +
 drivers/gpu/drm/i915/display/intel_sprite.c   |  15 ++-
 drivers/gpu/drm/i915/i915_reg.h               |  22 ++++
 include/drm/drm_crtc.h                        |  16 +++
 include/drm/drm_plane.h                       |  21 ++++
 13 files changed, 355 insertions(+), 4 deletions(-)

Comments

Simon Ser Oct. 13, 2020, 2:26 p.m. UTC | #1
On Monday, October 12, 2020 8:41 PM, Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> wrote:

> Now, Sameer has implemented Integer scaling in Kodi Retro gaming
> framework which demonstrate how Integer scaling gives distinctive
> look to pixel art games when played on higher resolution monitors.
>
> Kodi patches are reviewed and accepted for merge now.
>
> Here is the userspace patch series link:
> https://github.com/xbmc/xbmc/pull/18194

As a side note, these user-space patches hard-code the kernel enum
values [1]. This is something which we discussed some time ago [2],
the result of the discussion is that user-space shouldn't do that.

[1]: https://github.com/xbmc/xbmc/pull/18194/files#diff-94967b31726326769b31635c3dd7fc9b50d003057b49306a136b6b702795dd96R30
[2]: https://lists.freedesktop.org/archives/dri-devel/2020-April/261055.html
Simon Ser Oct. 20, 2020, 1:33 p.m. UTC | #2
On Tuesday, October 13, 2020 4:26 PM, Simon Ser <contact@emersion.fr> wrote:

> On Monday, October 12, 2020 8:41 PM, Pankaj Bharadiya pankaj.laxminarayan.bharadiya@intel.com wrote:
>
> > Now, Sameer has implemented Integer scaling in Kodi Retro gaming
> > framework which demonstrate how Integer scaling gives distinctive
> > look to pixel art games when played on higher resolution monitors.
> > Kodi patches are reviewed and accepted for merge now.
> > Here is the userspace patch series link:
> > https://github.com/xbmc/xbmc/pull/18194
>
> As a side note, these user-space patches hard-code the kernel enum
> values [1]. This is something which we discussed some time ago [2],
> the result of the discussion is that user-space shouldn't do that.

Sameer has submitted a pull request [1] to fix this. Thanks, this looks
good to me from a uAPI usage point-of-view!

[1]: https://github.com/xbmc/xbmc/pull/18567