Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer Scaling support implementation to improve the viewing quality of Pixel Art games #18194

Merged
merged 4 commits into from
Oct 11, 2020

Conversation

slattann
Copy link
Contributor

Background:
Blurry outputs during up-scaling the video buffer, is a generic problem of graphics industry. One of the major reason behind this blurriness is the interpolation of pixel values used by most of the up-scaling hardware.

Nearest-neighbor is a scaling filter type, which works by filling in the missing color values in the up-scaled image with that of the coordinate-mapped nearest source pixel value.

Nearest-neighbor can produce (almost) non-blurry scaling outputs when the scaling ratio is complete integer. For example:

input buffer resolution: 1280x720(HD)
output buffer resolution: 3840x2160(UHD/4K)
scaling ratio (h) = 3840/1280 = 3
scaling ratio (v) = 2160/720 = 3
In such scenarios, we should try to pick Nearest-neighbor as scaling method when possible.

Some references:

This patch series:
To address this feature kernel driver exposes new CRTC/Plane property called
"SCALING_FILTER" and gives an option to userspace to set it based on the use
cases.
Kernel RFC can be found here: https://patchwork.freedesktop.org/series/73883/#rev6

This patchset add support for utilizing CRTC/Plane scaling filter property based on
client's usecase.

Here are the patches details:
Patch 1/4 --> [Settings] adding Display Engine (DE) HW scaling filter option into setting menu
Patch 2/4 --> [RetroPlayer] videofilter and stretch setting control
Patch 3/4 --> [GameFrame] Setting Game frame to Window size, to avoid GL scaling when DE HW could do
Patch 4/4 --> [DRMAtomic] add scaling_filter property support at plane level

Awaiting your reviews and what do you think on having Integer Scaling in Kodi. Thanks
-Sameer Lattannavar

@lrusak
Copy link
Contributor

lrusak commented Jul 20, 2020

Please use clang-format as there is a bunch of formatting errors. It would be easier to correct this first rather than have us comment on each problem. Thanks!

@@ -7,7 +7,11 @@
*/

#include "RPBaseRenderer.h"

#include "ServiceBroker.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A design constraint is that ServiceBroker.h isn't allowed in this file. See how other singletons are handled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will take care of this.

@@ -47,6 +47,11 @@
<setting id="videoscreen.screen">
<visible>false</visible>
</setting>
<setting id="videoscreen.hwscalingfilter" type="boolean" label="39120" help="39121">
<level>3</level>
<default>false</default>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a cool feature. Why default it to off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, let me know if you want me to make it default ON.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @garbear , I have done the changes and updated the PR, kindly let me know if anything else needs to be done from my side to take it forward.

uint32_t w_scale_factor;
uint32_t h_scale_factor;
for (uint32_t i = 0; i < object->props->count_props; i++)
if (!strcmp(object->props_info[i]->name, name))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use CDRMUtils::SupportsProperty. You may also want to use CDRMUtils::SupportsPropertyAndValue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CDRMUtils::SupportsProperty & CDRMUtils::SupportsPropertyAndValue check particular property & value passed exists or not, but in this particular case we are traversing through Property and when we find the property (SCALING_FILTER) and then traverse through its supported types ("Nearest Neighbor", "Default" ..etc) then we set type ("Nearest Neighbor") value.
But wherever needs to check the property existence, will use CDRMUtils::SupportsProperty & CDRMUtils::SupportsPropertyAndValue.
Ex:
if (SupportsProperty(m_gui_plane, "SCALING_FILTER"))
{
const std::shared_ptr settings =
CServiceBroker::GetSettingsComponent()->GetSettings();
settings->GetSetting(SETTING_VIDEOSCREEN_HW_SCALING_FILTER)->SetVisible(true);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree, you could simply do

if (SupportsPropertyAndValue(m_gui_plane, "SCALING_FILTER", "Nearest Neighbor"))
  AddProperty(m_gui_plane, "SCALING_FILTER", "Nearest Neighbor")

You are asking for a specific value ("Nearest Neighbor") anyways, so there is no reason to traverse all the values. You could traverse all the values if you wanted to create a settingsfilter that will populate based on the enum values of "SCALING_FILTER", but that is only needed if you want to use other methods than just "Nearest Neighbor" and "Default".

Copy link
Contributor Author

@slattann slattann Aug 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lrusak Please let me know if this is ok, I will incorporate.
I validated it and it works fine.
enum drm_scaling_filter { DRM_SCALING_FILTER_DEFAULT, DRM_SCALING_FILTER_NEAREST_NEIGHBOR, };
int32_t CDRMAtomic::GetScalingFilterType(const char* type) { if (!strcmp(type, "Nearest Neighbor")) return DRM_SCALING_FILTER_NEAREST_NEIGHBOR; else return DRM_SCALING_FILTER_DEFAULT; }
bool CDRMAtomic::SetScalingFilter(struct drm_object* object, const char* name, const char* type) { uint32_t iType = GetScalingFilterType(type); if (SupportsPropertyAndValue(object, name, iType)) if (AddProperty(object, name, iType)) { CLog::Log(LOGDEBUG, "CDRMAtomic::{}, Window size: {}x{}", __FUNCTION__, m_width, m_height); < . . . > return true; } return false; }

@@ -422,6 +422,7 @@ const std::string CSettings::SETTING_GENERAL_ADDONBROKENFILTER = "general.addonb
const std::string CSettings::SETTING_SOURCE_VIDEOS = "source.videos";
const std::string CSettings::SETTING_SOURCE_MUSIC = "source.music";
const std::string CSettings::SETTING_SOURCE_PICTURES = "source.pictures";
const std::string CSettings::SETTING_VIDEOSCREEN_HW_SCALING_FILTER="videoscreen.hwscalingfilter";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to live here. Better to put it where it is used. (We have moved away from putting specific settings in CSettings)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this will be moved appropriately in using file.

@@ -389,7 +389,7 @@ class CSettings : public CSettingsBase, public CSettingCreator, public CSettingC
static const int VIDEOLIBRARY_PLOTS_SHOW_UNWATCHED_MOVIES = 0;
static const int VIDEOLIBRARY_PLOTS_SHOW_UNWATCHED_TVSHOWEPISODES = 1;
static const int VIDEOLIBRARY_THUMB_SHOW_UNWATCHED_EPISODE = 2;

static const std::string SETTING_VIDEOSCREEN_HW_SCALING_FILTER;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take care.

@garbear
Copy link
Member

garbear commented Jul 20, 2020

Good job on the PR. Game dialog part looks perfect.

This is a really cool feature. Why not optimistically make it the default if support is detected?

@sarbes
Copy link
Member

sarbes commented Jul 21, 2020

Nice work, I'll compile it for my N4100 laptop as soon as I have the time.

Just for my understanding, scaling non-square pixels (lets say a 4:3, 256x244 SNES game) would result in columns with uneven width?

@lrusak
Copy link
Contributor

lrusak commented Jul 21, 2020

Nice work, I'll compile it for my N4100 laptop as soon as I have the time.

Just for my understanding, scaling non-square pixels (lets say a 4:3, 256x244 SNES game) would result in columns with uneven width?

@sarbes be aware that this is specific to kodi-gbm and requires the correct hardware that supports integer scaling (newer intel hardware) and possibly some kernel patches to expose the correct drm properties needed.

@slattann
Copy link
Contributor Author

(newer intel hardware)

@sarbes you can refer these kernel patches: https://patchwork.freedesktop.org/series/73883/#rev6
and try on platforms like Icelake or newer hardware.

@slattann slattann marked this pull request as draft July 22, 2020 13:12
@slattann slattann marked this pull request as ready for review July 22, 2020 13:28
@slattann
Copy link
Contributor Author

Updated the review comments with the changes, kindly review and let me know if changes needed my attention. Thanks

@@ -47,6 +47,11 @@
<setting id="videoscreen.screen">
<visible>false</visible>
</setting>
<setting id="videoscreen.hwscalingfilter" type="boolean" label="39120" help="39121">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will fix.

xbmc/Application.cpp Outdated Show resolved Hide resolved
xbmc/settings/Settings.h Outdated Show resolved Hide resolved
Copy link
Contributor

@lrusak lrusak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall you still need to run clang-format, there is a bunch of small formatting errors.

@ppaalanen
Copy link

Hi, a reminder just in case, hopefully this is not news to anyone:

This MR needs review acceptance so that the kernel patches can be merged, but this MR must NOT be merged until the Linux kernel patches have been merged into a non-rebasing upstream kernel tree.

For more information, see: https://www.kernel.org/doc/html/latest/gpu/drm-uapi.html#open-source-userspace-requirements

Copy link
Member

@garbear garbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! @lrusak any comments left?

@lrusak
Copy link
Contributor

lrusak commented Oct 7, 2020

Great! @lrusak any comments left?

I'm ok with the changes. I don't love the changes to the drm system especially with the changes upcoming in #18491 but I can live with it and refactor the changes later.

@slattann what are the next steps? Do you need this to be approved before sending the patches for the kernel interface?

@slattann
Copy link
Contributor Author

slattann commented Oct 8, 2020

Great! @lrusak any comments left?

I'm ok with the changes. I don't love the changes to the drm system especially with the changes upcoming in #18491 but I can live with it and refactor the changes later.

@slattann what are the next steps? Do you need this to be approved before sending the patches for the kernel interface?

@lrusak It would be good if you give us MR acceptance, so that we can take that to Kernel changes to get merged. Following which you can help us to merge this PR.
Thanks and appreciate support from @garbear and you.

@garbear garbear added this to the Matrix 19.0-alpha 3 milestone Oct 11, 2020
@garbear garbear merged commit e1e2494 into xbmc:master Oct 11, 2020
@ppaalanen
Copy link

@garbear Did you see the kernel patches land in a non-rebasing kernel git tree?

No-one commented here that they did, or where they landed.

If they have not landed yet, this MR should not have been merged! If the kernel patches have not landed, please make sure this feature does not end up in any release of XBMC in a way that it might be used without code changes.

For more information, see
https://www.kernel.org/doc/html/latest/gpu/drm-uapi.html#open-source-userspace-requirements :

The kernel patch can only be merged after all the above requirements are met, but it must be merged to either drm-next or drm-misc-next before the userspace patches land.

I already mentioned this in #18194 (comment) in this very MR.

In the worst case, if you release XBMC with this feature enabled, and then kernel review comes up with changes to the UAPI, it means both the kernel patches and the XBMC patches have to be thrown away and re-written so that the kernel changes landing cannot break any version of XBMC that uses the wrong UAPI.

The reason I'm nitpicking about this is not that I think such a conflict is likely, but to educate userspace developers of the kernel requirements. Essentially you are part of the kernel review process here.

@garbear
Copy link
Member

garbear commented Oct 12, 2020

@ppaalanen I missed the desired order of merge. I propose we disable the feature by default, and open another PR enabling the feature that can be a stand-in for this PR. The new PR will have the hard requirement that it can't be merged until the kernel patches land.

This PR missed our Alpha 2 release. Alpha 3 isn't due until October 25 so we don't have to worry about this being enabled in a release prematurely.

@slattann what do you think about this strategy?

@lrusak
Copy link
Contributor

lrusak commented Oct 12, 2020

I've added the commit to disable the feature in #18491 as 7f36caf

@slattann
Copy link
Contributor Author

slattann commented Oct 12, 2020

@garbear @lrusak @ppaalanen , Kernel patches are rebased again to the latest Linux-5.9.0-rc8+ and under review. Once they are merged we are good to make this into upcoming releases. What you guys say?

@garbear
Copy link
Member

garbear commented Oct 12, 2020

@lrusak Can you also default the setting to to false, maybe invisibilitalize it? (def. a word)

@slattann we're looking good on time. 2 weeks until an Alpha release, and it's just alpha. it'll be 3 weeks or more til beta. and we can enable whenever. we can easily work on kernel time at the moment

@ppaalanen
Copy link

Thank you very much for following the kernel procedure, kudos to @lrusak.

@slattann, just follow the kernel documentation on this, and make sure the patches are in the correct upstream branch before declaring them landed. Landing in arbitrary maintainer branches is not enough.

Thanks!

enum drm_scaling_filter
{
DRM_SCALING_FILTER_DEFAULT,
DRM_SCALING_FILTER_NEAREST_NEIGHBOR,
Copy link

@emersion emersion Oct 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This incorrectly hard-codes the values of the DRM enum here.

The uAPI doesn't have this guarantee, e.g. "Nearest Neighbor" could be exposed as the integer 5 in some other driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had discussed that point here before , In fact it was my initial implementation to read the DRM properties and set the proper value as per request. But later concluded on this implementation based on the discussions in this PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested AddProperty(m_gui_plane, "SCALING_FILTER", "Nearest Neighbor") code is fine because it doesn't hardcode the value for "Nearest Neighbor". The code here in this PR is not fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current AddProperty API does not take/pulls the valid values from DRM property, so went with the current implement with enums.
But if you think the code below make sense, we can incorporate the same instead.
bool CDRMAtomic::AddPropertyValueByName(struct drm_object* object, const char* name, const char* type) { for (uint32_t i = 0; i < object->props->count_props; i++) { if (!strcmp(object->props_info[i]->name, name)) { for (uint32_t j = 0; j < object->props_info[i]->count_enums; j++) { if (!strcmp(object->props_info[i]->enums[j].name, type)) { if (drmModeAtomicAddProperty(m_req, object->id, property_id, m_gui_plane->props_info[i]->enums[j].value) < 0) { CLog::Log(LOGERROR, "CDRMAtomic::%s - could not add property %s", __FUNCTION__, name); return false; } } } } } return true; }
This was the exact implementation which I had before.
Please let me know your thought on the same.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is very hard to read, please put it inside triple-backquotes like so:

```cpp
<insert code here>
```

Copy link
Contributor

@lrusak lrusak Oct 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the enum value is not in the uAPI. The enum value is exposed by the kernel at runtime via drmModePropertyRes. The enum value may change from one driver to another, and from one plane to another.

Only the enum name (the string) is in the uAPI.

That's no problem, we evaluate all properties for a drm object at startup. So if we need to expand the check or add another one that's fine.

Copy link

@emersion emersion Oct 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is this enum. The value of DRM_SCALING_FILTER_NEAREST_NEIGHBOR is hard-coded to 1, returned from CDRMAtomic::GetScalingFilterType, then passed as-is to AddProperty in CDRMAtomic::SetScalingFilter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is this enum. The value of DRM_SCALING_FILTER_NEAREST_NEIGHBOR is hard-coded to 1, returned from CDRMAtomic::GetScalingFilterType, then passed as-is to AddProperty in CDRMAtomic::SetScalingFilter.

it can be fixed 😺

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It must be fixed. @emersion is right.

This is actually one of those kinds of bugs that could lead to problems for kernel developers later, if they have to work around broken userspace assumptions to keep broken userspace working.

The general rule indeed is that KMS property enum values MUST be recognized by their string names, not by their numeric values. Unfortunately the KMS UAPI has past mistakes where the numerical values are already in the UAPI headers - that cannot be fixed, but all new KMS properties need to follow the rules, hence userspace can't pick an enum value by number. That is the reason you also cannot find the numbers in the kernel/libdrm UAPI headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created another PR for the fix: #18567
Kindly let me know if that is fine and we can go ahead w/ this PR and get Kernel patches reviewed and merged ?

@slattann
Copy link
Contributor Author

Thank you very much for following the kernel procedure, kudos to @lrusak.

@slattann, just follow the kernel documentation on this, and make sure the patches are in the correct upstream branch before declaring them landed. Landing in arbitrary maintainer branches is not enough.

Thanks!

Yes @ppaalanen , we are planning to merge into drm-tip.

Thanks for bringing in discipline to merge both Kernel & user space changes for the feature.
@garbear & @lrusak , Thanks for your support throughout.

riverzhou pushed a commit to riverzhou/chromiumkernel that referenced this pull request Feb 22, 2021
…erties

Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
(cherry picked from commit 5c759ed)

BUG=b:179453336
TEST=eDP comes up on brya when built with this commit https://crrev.com/i/3584703

Resolved conflicts in:
	include/drm/drm_crtc.h
due to commit "19e5b4e086cb FROMGIT: drm/msm/atomic: Drop per-CRTC locks
in reverse order" already present

Change-Id: Idcb58759f4ba9bfbc6beb46477bf7a9c390d0d98
Signed-off-by: Azhar Shaikh <azhar.shaikh@intel.com>
liux2085 pushed a commit to liux2085/linux-yocto-5.10 that referenced this pull request Sep 27, 2021
commit 5c759eda9b04cd1047b4cda8ac1eaadf8a9e4fce upstream.

Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request May 4, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request May 4, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request May 26, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Jun 4, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Jun 15, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Aug 10, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Aug 10, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Aug 26, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Sep 20, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Sep 22, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Sep 28, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Oct 2, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
dumbbell pushed a commit to dumbbell/drm-kmod that referenced this pull request Nov 11, 2022
Introduce per-plane and per-CRTC scaling filter properties to allow
userspace to select the driver's default scaling filter or
Nearest-neighbor(NN) filter for upscaling operations on CRTC and
plane.

Drivers can set up this property for a plane by calling
drm_plane_create_scaling_filter() and for a CRTC by calling
drm_crtc_create_scaling_filter().

NN filter works by filling in the missing color values in the upscaled
image with that of the coordinate-mapped nearest source pixel value.

NN filter for integer multiple scaling can be particularly useful for
for pixel art games that rely on sharp, blocky images to deliver their
distinctive look.

changes since: v6:
* Move property doc to existing "Standard CRTC Properties" and
  "Plane Composition Properties" doc comments (Simon)
changes since v3:
* Refactor code, add new function for common code (Ville)
changes since v2:
* Create per-plane and per-CRTC scaling filter property (Ville)
changes since v1:
* None
changes since RFC:
* Add separate properties for plane and CRTC (Ville)

Link: xbmc/xbmc#18194
Link: xbmc/xbmc#18567
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Acked-by: Simon Ser <contact@emersion.fr>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020161427.6941-2-pankaj.laxminarayan.bharadiya@intel.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Games Type: Feature non-breaking change which adds functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants