1. 27 3月, 2017 1 次提交
  2. 09 2月, 2017 1 次提交
  3. 15 12月, 2016 3 次提交
    • V
      drm: Nuke fb->pixel_format · 438b74a5
      Ville Syrjälä 提交于
      Replace uses of fb->pixel_format with fb->format->format.
      Less duplicated information is a good thing.
      
      Note that coccinelle failed to eliminate the
      "/* fourcc format */" comment from drm_framebuffer.h, so I had
      to do that part manually.
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       drm_helper_mode_fill_fb_struct(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       i9xx_get_initial_plane_config(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       ironlake_get_initial_plane_config(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       skylake_get_initial_plane_config(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *a;
      struct drm_framebuffer b;
      @@
      (
      - a->pixel_format
      + a->format->format
      |
      - b.pixel_format
      + b.format->format
      )
      
      @@
      struct drm_plane_state *a;
      struct drm_plane_state b;
      @@
      (
      - a->fb->pixel_format
      + a->fb->format->format
      |
      - b.fb->pixel_format
      + b.fb->format->format
      )
      
      @@
      struct drm_crtc *CRTC;
      @@
      (
      - CRTC->primary->fb->pixel_format
      + CRTC->primary->fb->format->format
      |
      - CRTC->primary->state->fb->pixel_format
      + CRTC->primary->state->fb->format->format
      )
      
      @@
      struct drm_mode_set *set;
      @@
      (
      - set->fb->pixel_format
      + set->fb->format->format
      |
      - set->crtc->primary->fb->pixel_format
      + set->crtc->primary->fb->format->format
      )
      
      @@
      @@
       struct drm_framebuffer {
      	 ...
      -	 uint32_t pixel_format;
      	 ...
       };
      
      v2: Fix commit message (Laurent)
          Rebase due to earlier removal of many fb->pixel_format uses,
          including the 'fb->format = drm_format_info(fb->format->format);'
          snafu
      v3: Adjusted the semantic patch a bit and regenerated due to code
          changes
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1481751175-18463-1-git-send-email-ville.syrjala@linux.intel.com
      438b74a5
    • V
      drm: Nuke fb->bits_per_pixel · 272725c7
      Ville Syrjälä 提交于
      Replace uses of fb->bits_per_pixel with fb->format->cpp[0]*8.
      Less duplicated information is a good thing.
      
      Note that I didn't put parens around the cpp*8 in the below cocci script,
      on account of not wanting spurious parens all over the place. Instead I
      did the unsafe way, and tried to look over the entire diff to spot if
      any dangerous expressions were produced. I didn't see any.
      
      There are some cases where previously the code did X*bpp/8, so the
      division happened after the multiplication. Those are now just X*cpp
      so the division effectively happens before the multiplication,
      but that is perfectly fine since bpp is always a multiple of 8.
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       drm_helper_mode_fill_fb_struct(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       i9xx_get_initial_plane_config(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       ironlake_get_initial_plane_config(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       skylake_get_initial_plane_config(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer FB;
      expression E;
      @@
      (
      - E * FB.bits_per_pixel / 8
      + E * FB.format->cpp[0]
      |
      - FB.bits_per_pixel / 8
      + FB.format->cpp[0]
      |
      - E * FB.bits_per_pixel >> 3
      + E * FB.format->cpp[0]
      |
      - FB.bits_per_pixel >> 3
      + FB.format->cpp[0]
      |
      - (FB.bits_per_pixel + 7) / 8
      + FB.format->cpp[0]
      |
      - FB.bits_per_pixel
      + FB.format->cpp[0] * 8
      |
      - FB.format->cpp[0] * 8 != 8
      + FB.format->cpp[0] != 1
      )
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
      (
      - E * FB->bits_per_pixel / 8
      + E * FB->format->cpp[0]
      |
      - FB->bits_per_pixel / 8
      + FB->format->cpp[0]
      |
      - E * FB->bits_per_pixel >> 3
      + E * FB->format->cpp[0]
      |
      - FB->bits_per_pixel >> 3
      + FB->format->cpp[0]
      |
      - (FB->bits_per_pixel + 7) / 8
      + FB->format->cpp[0]
      |
      - FB->bits_per_pixel
      + FB->format->cpp[0] * 8
      |
      - FB->format->cpp[0] * 8 != 8
      + FB->format->cpp[0] != 1
      )
      
      @@
      struct drm_plane_state *state;
      expression E;
      @@
      (
      - E * state->fb->bits_per_pixel / 8
      + E * state->fb->format->cpp[0]
      |
      - state->fb->bits_per_pixel / 8
      + state->fb->format->cpp[0]
      |
      - E * state->fb->bits_per_pixel >> 3
      + E * state->fb->format->cpp[0]
      |
      - state->fb->bits_per_pixel >> 3
      + state->fb->format->cpp[0]
      |
      - (state->fb->bits_per_pixel + 7) / 8
      + state->fb->format->cpp[0]
      |
      - state->fb->bits_per_pixel
      + state->fb->format->cpp[0] * 8
      |
      - state->fb->format->cpp[0] * 8 != 8
      + state->fb->format->cpp[0] != 1
      )
      
      @@
      @@
      - (8 * 8)
      + 8 * 8
      
      @@
      struct drm_framebuffer FB;
      @@
      - (FB.format->cpp[0])
      + FB.format->cpp[0]
      
      @@
      struct drm_framebuffer *FB;
      @@
      - (FB->format->cpp[0])
      + FB->format->cpp[0]
      
      @@
      @@
       struct drm_framebuffer {
      	 ...
      -	 int bits_per_pixel;
      	 ...
       };
      
      v2: Clean up the 'cpp*8 != 8' and '(8 * 8)' cases (Laurent)
      v3: Adjusted the semantic patch a bit and regenerated due to code
          changes
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
      Link: http://patchwork.freedesktop.org/patch/msgid/1481751140-18352-1-git-send-email-ville.syrjala@linux.intel.com
      272725c7
    • V
      drm: Replace drm_format_num_planes() with fb->format->num_planes · bcb0b461
      Ville Syrjälä 提交于
      Replace drm_format_num_planes(fb->pixel_format) with just
      fb->format->num_planes. Avoids the expensive format info lookup.
      
      @@
      struct drm_framebuffer *a;
      struct drm_framebuffer b;
      @@
      (
      - drm_format_num_planes(a->pixel_format)
      + a->format->num_planes
      |
      - drm_format_num_planes(b.pixel_format)
      + b.format->num_planes
      )
      
      @@
      struct drm_plane_state *a;
      struct drm_plane_state b;
      @@
      (
      - drm_format_num_planes(a->fb->pixel_format)
      + a->fb->format->num_planes
      |
      - drm_format_num_planes(b.fb->pixel_format)
      + b.fb->format->num_planes
      )
      
      @@
      struct drm_framebuffer *a;
      identifier T;
      @@
        T = a->pixel_format
      <+...
      - drm_format_num_planes(T)
      + a->format->num_planes
      ...+>
      
      @@
      struct drm_framebuffer b;
      identifier T;
      @@
        T = b.pixel_format
      <+...
      - drm_format_num_planes(T)
      + b.format->num_planes
      ...+>
      
      v2: Rerun spatch due to code changes
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Suggested-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1481751022-18015-1-git-send-email-ville.syrjala@linux.intel.com
      bcb0b461
  4. 24 8月, 2016 1 次提交
  5. 19 8月, 2016 2 次提交
  6. 04 7月, 2016 1 次提交
    • T
      drm/tegra: dc: Implement runtime PM · 33a8eb8d
      Thierry Reding 提交于
      Use runtime PM to clock-gate, assert reset and powergate the display
      controller. This ties in nicely with atomic DPMS in that a runtime PM
      reference is taken before a pipe is enabled and dropped after it has
      been shut down.
      
      To make sure this works, make sure to only ever update planes on active
      CRTCs, otherwise register accesses to a clock-gated and reset CRTC will
      hang the CPU.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      33a8eb8d
  7. 17 5月, 2016 2 次提交
  8. 31 3月, 2016 1 次提交
  9. 08 2月, 2016 1 次提交
  10. 14 12月, 2015 1 次提交
  11. 11 12月, 2015 2 次提交
    • V
      drm: Pass 'name' to drm_universal_plane_init() · b0b3b795
      Ville Syrjälä 提交于
      Done with coccinelle for the most part. It choked on
      msm/mdp/mdp5/mdp5_plane.c like so:
      "BAD:!!!!!  enum drm_plane_type type;"
      No idea how to deal with that, so I just fixed that up
      by hand.
      
      Also it thinks '...' is part of the semantic patch, so I put an
      'int DOTDOTDOT' placeholder in its place and got rid of it with
      sed afterwards.
      
      I didn't convert drm_plane_init() since passing the varargs through
      would mean either cpp macros or va_list, and I figured we don't
      care about these legacy functions enough to warrant the extra pain.
      
      @@
      typedef uint32_t;
      identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
      @@
       int drm_universal_plane_init(struct drm_device *dev,
                                    struct drm_plane *plane,
                                    unsigned long possible_crtcs,
                                    const struct drm_plane_funcs *funcs,
                                    const uint32_t *formats,
                                    unsigned int format_count,
                                    enum drm_plane_type type
      +                             ,const char *name, int DOTDOTDOT
                                    )
      { ... }
      
      @@
      identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
      @@
       int drm_universal_plane_init(struct drm_device *dev,
                                    struct drm_plane *plane,
                                    unsigned long possible_crtcs,
                                    const struct drm_plane_funcs *funcs,
                                    const uint32_t *formats,
                                    unsigned int format_count,
                                    enum drm_plane_type type
      +                             ,const char *name, int DOTDOTDOT
                                    );
      
      @@
      expression E1, E2, E3, E4, E5, E6, E7;
      @@
       drm_universal_plane_init(E1, E2, E3, E4, E5, E6, E7
      +                         ,NULL
                                )
      
      v2: Split crtc and plane changes apart
          Pass NUL for no-name instead of ""
          Leave drm_plane_init() alone
      v3: Add ', or NULL...' to @name kernel doc (Jani)
          Annotate the function with __printf() attribute (Jani)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449670795-2853-1-git-send-email-ville.syrjala@linux.intel.com
      b0b3b795
    • V
      drm: Pass 'name' to drm_crtc_init_with_planes() · f9882876
      Ville Syrjälä 提交于
      Done with coccinelle for the most part. However, it thinks '...' is
      part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
      in its place and got rid of it with sed afterwards.
      
      I didn't convert drm_crtc_init() since passing the varargs through
      would mean either cpp macros or va_list, and I figured we don't
      care about these legacy functions enough to warrant the extra pain.
      
      @@
      identifier dev, crtc, primary, cursor, funcs;
      @@
       int drm_crtc_init_with_planes(struct drm_device *dev,
                                     struct drm_crtc *crtc,
                                     struct drm_plane *primary, struct drm_plane *cursor,
                                     const struct drm_crtc_funcs *funcs
      +                              ,const char *name, int DOTDOTDOT
                                     )
      { ... }
      
      @@
      identifier dev, crtc, primary, cursor, funcs;
      @@
       int drm_crtc_init_with_planes(struct drm_device *dev,
                                     struct drm_crtc *crtc,
                                     struct drm_plane *primary, struct drm_plane *cursor,
                                     const struct drm_crtc_funcs *funcs
      +                              ,const char *name, int DOTDOTDOT
                                     );
      
      @@
      expression E1, E2, E3, E4, E5;
      @@
       drm_crtc_init_with_planes(E1, E2, E3, E4, E5
      +                          ,NULL
                                 )
      
      v2: Split crtc and plane changes apart
          Pass NULL for no-name instead of ""
          Leave drm_crtc_init() alone
      v3: Add ', or NULL...' to @name kernel doc (Jani)
          Annotate the function with __printf() attribute (Jani)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
      f9882876
  12. 31 10月, 2015 1 次提交
    • T
      drm/tegra: dc: Request/free syncpoint at init/exit · 2bcdcbfa
      Thierry Reding 提交于
      syncpoints are resources provided by host1x and their lifetime is tied
      to the host1x device. They are not properly reference counted either, so
      removing the host1x device before any of its clients causes a use-after-
      free error. Adding proper reference counting would be a major enterprise
      so work around it for now by requesting and freeing the syncpoint at
      init and exit time, respectively. The host1x device is guaranteed to be
      around at this point.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      2bcdcbfa
  13. 08 9月, 2015 1 次提交
  14. 13 8月, 2015 9 次提交
  15. 27 7月, 2015 1 次提交
  16. 03 4月, 2015 6 次提交
  17. 05 3月, 2015 1 次提交
  18. 19 2月, 2015 3 次提交
  19. 27 1月, 2015 2 次提交