drm/edid: move drm_edid_is_zero to top, make edid argument const

drm_edid_is_zero will be used by drm_edid_block valid, move it up.
raw_edid argument can be const.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm/edid: shorten log output in case of all zeroes edid block

There is no need to dump the whole EDID block in case it contains no
information. Just print a single line stating the block is empty instead
of 8 lines containing only zeroes.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm/edid: new drm_edid_block_checksum helper function V3

The function will also be used by a later patch, so factor it out.

V2: make raw_edid const, define/declare before first use
V3: fix erroneuos removal of csum variable

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm/edid: Restore kerneldoc consistency

Commit 18df89fef2d5 ("drm: Decouple EDID parsing from I2C adapter")
renamed the adapter parameter of the drm_do_probe_ddc_edid function
to data but didn't update the kerneldoc accordingly.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm/Documentation: Fix rowspan value in drm-kms-properties

The "DRM" rowspan wasn't updated in commit cc7096fb6d1d (drm/mode: document path
property and function to set it. (v1.1)), so increment it by one to fix the
table.

Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm: Fix memory leak at error path of drm_read()

Note that the read manpages explicitly states that the read position
is undefined on error. Since EFAULT is just a userspace bug we are
therefore fine with just dropping the event on the floor.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
[danvet: Add note that just dropping the event is ok.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm: fix a word repetition in a comment

Spotted while reviewing the DRM changes in Linux 3.18 for LinuxFR.

CC: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm: fix a typo in a comment

Spotted while reviewing the DRM changes in Linux 3.18 for LinuxFR.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm: Zero out DRM object memory upon cleanup

Drivers where the DRM objects have a lifetime that extends beyond that
of the DRM device need to zero out the DRM object memory to void stale
data such as properties. The DRM core code expects to operate on newly
allocated and zeroed out objects and will behave unexpectedly, such as
add duplicate properties, otherwise.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Merge tag 'topic/core-stuff-2014-12-10' of git://anongit.freedesktop.org/drm-intel into drm-next

Merge drm core fixes from Daniel.

* tag 'topic/core-stuff-2014-12-10' of git://anongit.freedesktop.org/drm-intel:
  drm: Zero out DRM object memory upon cleanup
  drm: fix a typo in a comment
  drm: fix a word repetition in a comment
  drm: Fix memory leak at error path of drm_read()
  drm/Documentation: Fix rowspan value in drm-kms-properties
  drm/edid: Restore kerneldoc consistency
  drm/edid: new drm_edid_block_checksum helper function V3
  drm/edid: shorten log output in case of all zeroes edid block
  drm/edid: move drm_edid_is_zero to top, make edid argument const
drm/doc: Document drm_add_modes_noedid() usage

And fix a spelling mistake.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>