aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss/dispc.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-15drm: omapdrm: Remove dss_features.hLaurent Pinchart1-1/+0
The header file only contains four macros, two of which are never used. Move the other two to dss.h and remove dss_features.h. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move supported outputs feature to dss driverLaurent Pinchart1-1/+1
The supported outputs feature is specific to the DSS, move it from the omap_dss_features structure to the dss driver. The omap_dss_features structure is now empty and can be removed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move DSS_FCK feature to dss driverLaurent Pinchart1-1/+1
The FEAT_PARAM_DSS_FCK feature is specific to the DSS, move it from the omap_dss_features structure to the dss driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move PCD, LINEWIDTH and DOWNSCALE features to dispc driverLaurent Pinchart1-14/+39
The FEAT_PARAM_DSS_PCD, FEAT_PARAM_LINEWIDTH and FEAT_PARAM_DOWNSCALE features are specific to the DISPC, move them from the omap_dss_features structure to the dispc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move FEAT_* features to dispc driverLaurent Pinchart1-67/+190
All the remaining FEAT_* features are specific to the DISPC, move them from the omap_dss_features structure to the dispc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move reg_fields to dispc_features structureLaurent Pinchart1-11/+76
The reg_fields feature describes DISPC registers only. Move it from the omap_dss_features structure to the dispc_features structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move num_ovls and num_mgrs to dispc_features structureLaurent Pinchart1-25/+66
The num_ovls and num_mgrs are dispc features. Move them from the omap_dss_features structure to the dispc_features structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move overlay caps features to dispc_features structureLaurent Pinchart1-4/+102
The overlay_caps is a dispc feature. Move it from the omap_dss_features structure to the dispc_features structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move color modes feature to dispc_features structureLaurent Pinchart1-3/+124
The supported_color_modes is a dispc feature. Move it from the omap_dss_features structure to the dispc_features structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: Move size unit features to dispc_features structureLaurent Pinchart1-7/+18
The buffer_size_unit and burst_size_unit are dispc features. Move them from the omap_dss_features structure to the dispc_features structure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-08-15drm: omapdrm: dispc: Select features based on compatible stringLaurent Pinchart1-60/+27
Use the compatible string instead of the OMAP SoC revision to determine device features. On OMAP34xx the features depend on the ES revision that can not be determined from the compatible string. Use soc_device_match() in that case. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-06-02drm/omap: fix YUV422 90/270 rotation with mirroringTomi Valkeinen1-2/+2
When rotating 90/270 + mirroring with YUV422, the end result will have adjacent pixels swapped. The problem is that dispc_ovl_set_rotation_attrs() has wrong rotation values for these cases. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: fix YUV422 rotation with TILERTomi Valkeinen1-2/+18
TILER rotation with YUV422 pixelformats does not work at the moment. All other pixel formats work, because the pixelformat's pixel size is equal to tiler unit size (e.g. XR24's pixel size is 32 bits, and the TILER unit size that has to be used is 32 bits). For YUV422 formats this is not the case, as the TILER unit size has to be 32 bits, but the pixel size is 16 bits. The end result is OCP errors and sync losts. This patch adds the code to adjust the variables for YUV422 formats. We could make the code more generic by passing around the pixel format, rotation type, angle and the tiler unit size, which would allow us to do calculations without special case for YUV422. However, this would make the code more complex, and at least for now this is much more easier to handle with these two special cases for YUV422. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: DRM_MODE_REFLECT_* instead of mirror booleanTomi Valkeinen1-14/+10
Change dispc driver to use the DRM_MODE_REFLECT flags instead of a mirror boolean. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: use DRM_MODE_ROTATE_* instead of OMAP_DSS_ROT_*Tomi Valkeinen1-30/+30
At the moment the dispc driver uses a custom enum for rotation. Change it to use the DRM's DRM_MODE_ROTATE_*. Note that mirroring is at the moment handled as a separate boolean in the dispc driver, so we only use the DRM_MODE_ROTATE_* values. Note, DSS HW uses clockwise rotation, DRM counter-clockwise. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: rename color_mode to fourccTomi Valkeinen1-56/+52
Now that we use fourccs, we can also rename the 'color_mode' variables to 'fourcc'. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: use DRM_FORMAT_* instead of OMAP_DSS_COLOR_*Tomi Valkeinen1-71/+72
This patch changes omapdrm to use DRM_FORMAT_* values instead of OMAP_DSS_COLOR_* enum. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: use u32 instead of enum omap_color_modeTomi Valkeinen1-17/+17
In this step we drop 'enum omap_color_mode', and use u32 instead. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: change supported_modes to an arrayTomi Valkeinen1-1/+1
enum omap_color_mode is a bitmask, so at the moment we present the supported color modes as mask. To be able to move to fourccs, we need to use an array to present the supported color modes. As a first step towards fourccs, this patch changes the code to use an array to store the enums. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: add format_is_yuv() helperTomi Valkeinen1-33/+23
In a few places the dispc driver needs to know whether the pixel format is an YUV format. Add a helper to figure that out. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: cleanup offset calculationTomi Valkeinen1-4/+2
The code to calculate offset in dispc's calc_offset() is overly complex. Simplify it. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: remove dma & vrfb rotationTomi Valkeinen1-242/+6
We have three rotation methods supported by the SoCs with DSS: DMA, VRFB and TILER. DMA rotation works in theory on all DSS platforms, but in practice it's unusable due to the huge amount of memory bandwidth it uses, and has never really been used. VRFB is available on OMAP3, but is not supported by omapdrm, even though we have some code for it in the dispc driver. TILER is supported on OMAP4/OMAP5/DRA7/AM5 platforms, but has some driver bugs. To clean up the driver to help fixing the TILER issues, this patch drops the DMA and VRFB rotation support, leaving only TILER rotation. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: remove CLUTTomi Valkeinen1-55/+2
DSS IP versions 2 and 3 support CLUT modes (color lookup table), but the driver has never supported those. We still have had some code for CLUT modes. As the newer DSS IP versions have dropped CLUT support, we might as well clean up the driver by removing the CLUT related code. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: fix setting & clearing DOUBLESTRIDETomi Valkeinen1-5/+6
The code that sets and clears DOUBLESTRIDE is only ran when using NV12. This is not correct, as we might first set the bith when using NV12, but never clear it when using other formats. Fix it so that when the bit is available (when the HW supports NV12) we always either set or clear the bit. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: remove read_irqenable()Tomi Valkeinen1-6/+3
We only use read_irqenable() to flush posted write. Instead of having a separate function for this, do the flush implicitly in write_irqenable(). Thus we can remove read_irqenable(). Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: remove ovl_set_channel_outTomi Valkeinen1-7/+6
At the moment we have ovl_set_channel_out() to configure the output channel of an overlay. It makes sense to have this configuration as part of the rest of overlay configuration, and in DSS6+ we need the output channel when doing the other overlay configuration. This patch adds a 'channel' parameter to ovl_setup(), so that all overlay configuration is done via the same function, and removes the ovl_set_channel_out(). Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm/omap: remove unused ovl_enabled()Tomi Valkeinen1-6/+0
ovl_enabled() is not used anywhere, so remove it. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-06-02drm: omapdrm: Remove duplicate error messages when mapping memoryLaurent Pinchart1-11/+3
The devm_ioremap_resource() call can handle being given a NULL resource, and prints an error message when mapping fails. Switch the remaining devm_ioremap() calls to devm_ioremap_resource() and remove all extraneous resource NULL checks and error messages printed manually by the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: Fix one ugly indentation style break left by coccinelleJyri Sarha1-3/+2
Fix one ugly indentation style break left by the previous coccilnelle patch. Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: Rename enum omap_plane to enum omap_plane_idJyri Sarha1-56/+68
The enum omap_plane conflicted with the same struct name for omapdrm plane private data. This rename should solve the conflict. The rename was implement with this very simple coccinelle patch: ------------------------ @@ @@ enum -omap_plane +omap_plane_id ------------------------ The patch was applied like this: spatch --sp-file <cocci_file> --all-includes --in-place --dir drivers/gpu/drm/omapdrm The above patch did not rename the actual enum definition. That was added manually on top of the spatch changes. Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: dispc: improve debug print of display flagsTomi Valkeinen1-5/+15
Instead of printing 0/1 for display flags like vsync high/low, use a tri-state print (-1/0/1) to indicate the "undefined" state. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: fix replication logicTomi Valkeinen1-3/+4
DSS uses "replication logic" to convert color components from smaller bit widths to bigger bit widths. Without replication logic, the color component would be shifted and the least significant bits would be left at 0, whereas with replication logic, the least significat bits will be filled with the most significant bit. For some reason omapdrm leaves replication logic always to off, which, in the most common case, means that showing 16-bit RGB colors on 24-bit display gives a bit darker colors than expected. The reset value of the replication logic bit is enabled, and it should always be set, as there's no practical reason to disable it. This patch removes the option to disable it from omapdrm, and always sets it to enabled in dispc. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-04-03drm/omap: remove unused dispc_wb_enable & dispc_wb_is_enabledTomi Valkeinen1-10/+0
Remove two unused WB functions. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-04-03drm/omap: remove all EXPORT_SYMBOLs from dispc.cTomi Valkeinen1-54/+30
omapdrm now uses dispc_ops instead of direct function calls so we can remove all EXPORT_SYMBOLs from dispc. Most of the functions can also be made static, but a few are used outside dispc.c. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: fill dispc_opsTomi Valkeinen1-0/+40
This patch changes the current omapdss driver to fill a dispc_ops struct and set it to omapdss-base. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-03drm/omap: move dispc related dss-feat funcs to dispcTomi Valkeinen1-0/+18
omapdrm still uses a few non-dispc functions: dss_feat_get_num_mgrs(), dss_feat_get_num_ovls() and dss_feat_get_supported_color_modes(). We want to provide omapdrm a single dispc_ops function pointer struct so that omapdrm will use either the current omapdss or the new omapdss6 driver depending on the platform. Those three functions are really dispc functions, but are located in the dss_features.c for legacy reasons. This patch adds similar functionss to the dispc, and changes omapdrm to use those new functions. Underneath the functions still call the functions from dss_feature.c. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-16drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formatsJyri Sarha1-0/+19
Let's disable all scaling that requires horizontal decimation with higher factor than 4, until we have better estimates of what we can and can not do. However, NV12 color format appears to work Ok with all decimation factors. When decimating horizontally by more that 4 the dss is not able to fetch the data in burst mode. When this happens it is hard to tell if there enough bandwidth. Despite what theory says this appears to be true also for 16-bit color formats. Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-12-19drm: omapdrm: Check the CRTC software state at enable/disable timeLaurent Pinchart1-14/+13
The omapdrm DSS manager enable/disable operations check the DSS manager state to avoid double enabling/disabling. Check the CRTC software state instead to decrease the dependency of the DRM layer to the DSS layer. The dispc_mgr_is_enabled() function then be turned into a static function, but needs to be moved up in its compilation unit to avoid a forward declaration. Add a WARN_ON to catch double enable or disable that should be prevented by the DRM core and would be a clear sign of a bug. The warning should eventually be removed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: Use consistent name for struct videomodePeter Ujfalusi1-58/+56
Use 'vm' to refer to a struct videomode instead of 'p', 't', 'timings' or something else. The code will be easier to follow if we use consistent names. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: Replace struct omap_video_timings with videomodePeter Ujfalusi1-15/+15
omap_video_timings can be replaced with the generic videomode in omapdrm and the omap_video_timings can be removed. This patch will replace the omap_video_timings with videomode. With the change we no longer need the functions to convert to/from videomode and drm_display_mode to omap_video_timings, these can be removed as well. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: Change the types of struct omap_video_timings membersPeter Ujfalusi1-2/+3
omap_video_timings struct have the same members as struct videomode, but their types are different. As first step change the types of the omap_video_timings struct members to match their counterpart in struct videomode to catch any type cast related issues. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: Use display_flags for sync edgePeter Ujfalusi1-12/+6
In preparation to move the stack to use the generic videmode struct for display timing information use display_flags for sync edge. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: Use display_flags for pixel data edgePeter Ujfalusi1-11/+5
In preparation to move the stack to use the generic videmode struct for display timing information use display_flags for pixel data edge. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: Use display_flags for double_pixel modePeter Ujfalusi1-3/+3
In preparation to move the stack to use the generic videmode struct for display timing information use display_flags for double_pixel mode. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: Use display_flags for DE levelPeter Ujfalusi1-12/+7
In preparation to move the stack to use the generic videmode struct for display timing information use display_flags for DE level. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: Use display_flags for h/vsync levelPeter Ujfalusi1-22/+11
In preparation to move the stack to use the generic videmode struct for display timing information use display_flags for h/vsync level. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: dispc: Simplify _dispc_mgr_set_lcd_timings() parametersPeter Ujfalusi1-24/+14
Instead of passing the omap_video_timings structure's members individually, use the pointer to the struct. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: Use display_flags for interlace modePeter Ujfalusi1-4/+3
Remove the interlace member and add display_flags to omap_video_timings to configure the interlace mode. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: rename vbp to vback_porchPeter Ujfalusi1-7/+8
In preparation to move the stack to use the generic videmode struct for display timing information rename the vbp member to vback_porch. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2016-11-02drm/omap: omap_display_timings: rename vfp to vfront_porchPeter Ujfalusi1-7/+8
In preparation to move the stack to use the generic videmode struct for display timing information rename the vfp member to vfront_porch. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>