Skip to content

Commit

Permalink
drm/layerscape: reduce excessive stack usage
Browse files Browse the repository at this point in the history
The fsl-dcu driver copies a drm_mode_config object to its
stack but then only accesses a single member (dpms_property)
once. The data structure is large enough to trigger a warning
about the amount of kernel stack being used:

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c: In function 'fsl_dcu_drm_connector_create':
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c:182:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This changes the fsl_dcu_drm_connector_create() function to
only access the drm_mode_config by reference, which is also
more efficient.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 109eee2 ("drm/layerscape: Add Freescale DCU DRM driver")
Signed-off-by: Stefan Agner <stefan@agner.ch>
  • Loading branch information
Arnd Bergmann authored and Stefan Agner committed Apr 26, 2016
1 parent fb127b7 commit a5dab99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev,
struct drm_encoder *encoder)
{
struct drm_connector *connector = &fsl_dev->connector.base;
struct drm_mode_config mode_config = fsl_dev->drm->mode_config;
struct drm_mode_config *mode_config = &fsl_dev->drm->mode_config;
struct device_node *panel_node;
int ret;

Expand All @@ -164,7 +164,7 @@ int fsl_dcu_drm_connector_create(struct fsl_dcu_drm_device *fsl_dev,
goto err_sysfs;

drm_object_property_set_value(&connector->base,
mode_config.dpms_property,
mode_config->dpms_property,
DRM_MODE_DPMS_OFF);

panel_node = of_parse_phandle(fsl_dev->np, "fsl,panel", 0);
Expand Down

0 comments on commit a5dab99

Please sign in to comment.