Skip to content

Commit

Permalink
drm: Add RP1 VEC driver
Browse files Browse the repository at this point in the history
Add support for the RP1 VEC hardware.

Signed-off-by: Nick Hollinghurst <[email protected]>

drm: rp1: rp1-vec: Allow non-standard modes with various crops

Tweak sync timings in the advertised modelines.

Accept other, custom modes, provided they fit within the active
area of one of the existing hardware-supported TV modes.

Instead of always padding symmetrically, try to respect the user's
[hv]sync_start values, allowing the image to be shifted around
the screen (to fine-tune overscan correction).

Signed-off-by: Nick Hollinghurst <[email protected]>

drm/rp1: depends on, instead of select, MFD_RP1

According to kconfig-language.txt [1], select should be used only for
"non-visible symbols ... and for symbols with no dependencies". Since
MFD_RP1 both is visible and has a dependency, "select" should not be
used and "depends on" should be used instead.

In particular, this fixes the build of this kernel tree on NixOS, where
its kernel config system will try to answer 'M' to as many config as
possible.

[1] https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html

Signed-off-by: Ratchanan Srirattanamet <[email protected]>

drm: rp1: Use tv_mode from the command line and fix for Linux 6.6

Use the standard enum drm_connector_tv_mode instead of a private
enum and switch from the legacy to the standard tv_mode property.

Remove the module parameter "tv_norm". Instead, get tv_mode from
the command line and make this the connector's default TV mode.

Don't restrict the choice of modes based on tv_mode, but interpret
nonstandard combinations as NTSC or PAL, depending on resolution.
Thus the default tv_mode=NTSC effectively means "Auto".

Tweak the advertised horizontal timings for 625/50 to match Rec.601

Signed-off-by: Nick Hollinghurst <[email protected]>

drm: rp1: VEC and DPI drivers: Fix bug #5901

Rework probe() to use devm_drm_dev_alloc(), embedding the DRM
device in the DPI or VEC device as now seems to be recommended.

Change order of resource allocation and driver initialization.
This prevents it trying to write to an unmapped register during
clean-up, which previously could crash.

Signed-off-by: Nick Hollinghurst <[email protected]>
  • Loading branch information
njhollinghurst authored and popcornmix committed Oct 17, 2024
1 parent 0845842 commit 0aa4c97
Show file tree
Hide file tree
Showing 7 changed files with 3,025 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/gpu/drm/rp1/rp1-vec/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: GPL-2.0-only
config DRM_RP1_VEC
tristate "DRM Support for RP1 VEC"
depends on DRM && MFD_RP1
select DRM_GEM_DMA_HELPER
select DRM_KMS_HELPER
select DRM_VRAM_HELPER
select DRM_TTM
select DRM_TTM_HELPER
help
Choose this option to enable Video Out on RP1
5 changes: 5 additions & 0 deletions drivers/gpu/drm/rp1/rp1-vec/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only

drm-rp1-vec-y := rp1_vec.o rp1_vec_hw.o rp1_vec_cfg.o

obj-$(CONFIG_DRM_RP1_VEC) += drm-rp1-vec.o
Loading

0 comments on commit 0aa4c97

Please sign in to comment.