1. 15 12月, 2017 3 次提交
  2. 13 12月, 2017 1 次提交
    • K
      drm: Update edid-derived drm_display_info fields at edid property set [v2] · 170178fe
      Keith Packard 提交于
      There are a set of values in the drm_display_info structure for each
      connector which hold information derived from EDID. These are computed
      in drm_add_display_info. Before this patch, that was only called in
      drm_add_edid_modes. This meant that they were only set when EDID was
      present and never reset when EDID was not, as happened when the
      display was disconnected.
      
      One of these fields, non_desktop, is used from
      drm_mode_connector_update_edid_property, the function responsible for
      assigning the new edid value to the application-visible property.
      
      Various drivers call these two functions (drm_add_edid_modes and
      drm_mode_connector_update_edid_property) in different orders. This
      means that even when EDID is present, the drm_display_info fields may
      not have been computed at the time that
      drm_mode_connector_update_edid_property used the non_desktop value to
      set the non_desktop property.
      
      I've added a public function (drm_reset_display_info) that resets the
      drm_display_info field values to default values and then made the
      drm_add_display_info function public. These two functions are now
      called directly from drm_mode_connector_update_edid_property so that
      the drm_display_info fields are always computed from the current EDID
      information before being used in that function.
      
      This means that the drm_display_info values are often computed twice,
      once when the EDID property it set and a second time when EDID is used
      to compute modes for the device. The alternative would be to uniformly
      ensure that the values were computed once before being used, which
      would require that all drivers reliably invoke the two paths in the
      same order. The computation is inexpensive enough that it seems more
      maintainable in the long term to simply compute them in both paths.
      
      The API to drm_add_display_info has been changed so that it no longer
      takes the set of edid-based quirks as a parameter. Rather, it now
      computes those quirks itself and returns them for further use by
      drm_add_edid_modes.
      
      This patch also includes a number of 'const' additions caused by
      drm_mode_connector_update_edid_property taking a 'const struct edid *'
      parameter and wanting to pass that along to drm_add_display_info.
      
      v2: after review by Daniel Vetter <daniel.vetter@ffwll.ch>
      
      	Removed EXPORT_SYMBOL_GPL for drm_reset_display_info and
      	drm_add_display_info.
      
      	Added FIXME in drm_mode_connector_update_edid_property about
      	potentially merging that with drm_add_edid_modes to avoid
      	the need for two driver calls.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171213084427.31199-1-keithp@keithp.com
      170178fe
  3. 10 12月, 2017 1 次提交
  4. 08 12月, 2017 1 次提交
  5. 05 12月, 2017 3 次提交
    • H
      drm/fb-helper: Apply panel orientation connector prop to the primary plane, v6. · 8f0cb418
      Hans de Goede 提交于
      Apply the "panel orientation" drm connector prop to the primary plane so
      that fbcon and fbdev using userspace programs display the right way up.
      
      Changes in v3:
      -Use a rotation member in struct drm_fb_helper_crtc and set that from
       drm_setup_crtcs instead of looping over all crtc's to find the right one
       later
      -Since we now no longer look at rotation quirks directly in the fbcon
       code, set fb_info.fbcon_rotate_hint when the panel is not mounted upright
       and we cannot use hardware rotation
      
      Changes in v4:
      -Make drm_fb_helper_init() init drm_fb_helper_crtc.rotation to
       DRM_MODE_ROTATE_0 for all crtcs, so that we do not end up setting the
       plane_state's rotation to an invalid value for disabled crtcs
       (caught by Fi.CI)
      
      Changes in v5:
      -Only use hardware (crtc primary plane) rotation for DRM_ROTATE_180,
       90 / 270 degree rotation requires special handling which we lack atm
      -Add a TODO comment for 90 / 270 degree hardware rotation
      -Add some comments to better document the default case when mapping
       sw_rotations to fbcon_rotate_hints
      
      Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94894Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171125193553.23986-5-hdegoede@redhat.com
      8f0cb418
    • H
      drm: Add support for a panel-orientation connector property, v6 · 8d70f395
      Hans de Goede 提交于
      On some devices the LCD panel is mounted in the casing in such a way that
      the up/top side of the panel does not match with the top side of the
      device (e.g. it is mounted upside-down).
      
      This commit adds the necessary infra for lcd-panel drm_connector-s to
      have a "panel orientation" property to communicate how the panel is
      orientated vs the casing.
      
      Userspace can use this property to check for non-normal orientation and
      then adjust the displayed image accordingly by rotating it to compensate.
      
      Changes in v2:
      -Store panel_orientation in drm_display_info, so that drm_fb_helper.c can
       access it easily
      -Have a single drm_connector_init_panel_orientation_property rather then
       create and attach functions. The caller is expected to set
       drm_display_info.panel_orientation before calling this, then this will
       check for platform specific quirks overriding the panel_orientation and if
       the panel_orientation is set after this then it will attach the property.
      
      Changes in v6:
      -Use an enum (with kerneldoc) rather then #defines for
       DRM_MODE_PANEL_ORIENTATION_*
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171125193553.23986-4-hdegoede@redhat.com
      8d70f395
    • H
      drm: Add panel orientation quirks, v6. · 404d1a3e
      Hans de Goede 提交于
      Some x86 clamshell design devices use portrait tablet screens and a display
      engine which cannot rotate in hardware, so the firmware just leaves things
      as is and we cannot figure out that the display is oriented non upright
      from the hardware.
      
      So at least on x86, we need a quirk table for this. This commit adds a DMI
      based quirk table which is initially populated with 5 such devices: Asus
      T100HA, GPD Pocket, GPD win, I.T.Works TW891 and the VIOS LTH17.
      
      This quirk table will be used by the drm code to let userspace know that
      the display is not mounted upright inside the devices case through a new
      panel orientation drm-connector property, as well as to tell fbcon to
      rotate the console so that it shows the right way up.
      
      Changes in v5:
      -Add a kernel-doc comment documenting drm_get_panel_orientation_quirk()
      -Remove board_* matches from the dmi-matches for the VIOS LTH17 laptop,
       keeping only the (identical) sys_vendor and product_name matches.
       This is necessary because an older version of the bios has
       board_vendor set to VOIS instead of VIOS
      
      Changes in v6:
      -Add reference to added kernel-docs in Documentation/gpu/drm-kms-helpers.rst
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171125193553.23986-3-hdegoede@redhat.com
      404d1a3e
  6. 01 12月, 2017 3 次提交
  7. 30 11月, 2017 1 次提交
  8. 23 11月, 2017 3 次提交
  9. 21 11月, 2017 2 次提交
  10. 16 11月, 2017 1 次提交
  11. 15 11月, 2017 3 次提交
  12. 11 11月, 2017 8 次提交
  13. 10 11月, 2017 2 次提交
  14. 09 11月, 2017 1 次提交
  15. 07 11月, 2017 1 次提交
  16. 02 11月, 2017 2 次提交
    • L
      drm/drm_mm.h: Fix the name of the referenced function in comment · 0a2adb02
      Liviu Dudau 提交于
      drm_mm_insert_node_generic() is a simplified version of
      drm_mm_insert_node_in_range(), update comment to reflect correct
      function name.
      Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171101140445.2798-1-Liviu.Dudau@arm.com
      0a2adb02
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  17. 01 11月, 2017 2 次提交
  18. 27 10月, 2017 1 次提交
  19. 25 10月, 2017 1 次提交
    • K
      drm: Add four ioctls for managing drm mode object leases [v7] · 62884cd3
      Keith Packard 提交于
      drm_mode_create_lease
      
      	Creates a lease for a list of drm mode objects, returning an
      	fd for the new drm_master and a 64-bit identifier for the lessee
      
      drm_mode_list_lesees
      
      	List the identifiers of the lessees for a master file
      
      drm_mode_get_lease
      
      	List the leased objects for a master file
      
      drm_mode_revoke_lease
      
      	Erase the set of objects managed by a lease.
      
      This should suffice to at least create and query leases.
      
      Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
      
       * query ioctls only query the master associated with
         the provided file.
      
       * 'mask_lease' value has been removed
      
       * change ioctl has been removed.
      
      Changes for v3 suggested in part by Dave Airlie <airlied@gmail.com>
      
       * Add revoke ioctl.
      
      Changes for v4 suggested by Dave Airlie <airlied@gmail.com>
      
       * Expand on the comment about the magic use of &drm_lease_idr_object
       * Pad lease ioctl structures to align on 64-bit boundaries
      
      Changes for v5 suggested by Dave Airlie <airlied@gmail.com>
      
       * Check for non-negative object_id in create_lease to avoid debug
         output from the kernel.
      
      Changes for v6 provided by Dave Airlie <airlied@gmail.com>
      
       * For non-universal planes add primary/cursor planes to lease
      
         If we aren't exposing universal planes to this userspace client,
         and it requests a lease on a crtc, we should implicitly export the
         primary and cursor planes for the crtc.
      
         If the lessee doesn't request universal planes, it will just see
         the crtc, but if it does request them it will then see the plane
         objects as well.
      
         This also moves the object look ups earlier as a side effect, so
         we'd exit the ioctl quicker for non-existant objects.
      
       * Restrict leases to crtc/connector/planes.
      
         This only allows leasing for objects we wish to allow.
      
      Changes for v7 provided by Dave Airlie <airlied@gmail.com>
      
       * Check pad args are 0
       * Check create flags and object count are valid.
       * Check return from fd allocation
       * Refactor lease idr setup and add some simple validation
       * Use idr_mutex uniformly (Keith)
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      62884cd3