1. 09 1月, 2017 1 次提交
  2. 30 12月, 2016 1 次提交
  3. 18 12月, 2016 2 次提交
  4. 15 12月, 2016 6 次提交
    • 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: Nuke fb->depth · b00c600e
      Ville Syrjälä 提交于
      Replace uses of fb->depth with fb->format->depth. Less duplicate
      information is a good thing.
      
      @@
      struct drm_framebuffer *fb;
      expression E;
      @@
       drm_helper_mode_fill_fb_struct(...) {
      	...
      -	fb->depth = E;
      	...
       }
      
      @@
      struct nouveau_framebuffer *fb;
      @@
      - fb->base.depth
      + fb->base.format->depth
      
      @@
      struct drm_framebuffer fb;
      @@
      - fb.depth
      + fb.format->depth
      
      @@
      struct drm_framebuffer *fb;
      @@
      - fb->depth
      + fb->format->depth
      
      @@
      struct drm_framebuffer fb;
      @@
      - (fb.format->depth)
      + fb.format->depth
      
      @@
      struct drm_framebuffer *fb;
      @@
      - (fb->format->depth)
      + fb->format->depth
      
      @@
      @@
       struct drm_framebuffer {
      	 ...
      -	 unsigned int depth;
      	 ...
       };
      
      v2: Drop the vmw stuff (Daniel)
          Rerun spatch 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: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1481751095-18249-1-git-send-email-ville.syrjala@linux.intel.com
      b00c600e
    • V
      drm: Pass 'dev' to drm_helper_mode_fill_fb_struct() · a3f913ca
      Ville Syrjälä 提交于
      Pass the drm_device to drm_helper_mode_fill_fb_struct() so that we can
      populate fb->dev early. Will make it easier to use the fb before we
      register it.
      
      @@
      identifier fb, mode_cmd;
      @@
       void drm_helper_mode_fill_fb_struct(
      +				     struct drm_device *dev,
      				     struct drm_framebuffer *fb,
      				     const struct drm_mode_fb_cmd2 *mode_cmd
      				     );
      
      @@
      identifier fb, mode_cmd;
      @@
       void drm_helper_mode_fill_fb_struct(
      +				     struct drm_device *dev,
      				     struct drm_framebuffer *fb,
      				     const struct drm_mode_fb_cmd2 *mode_cmd
      				     )
      { ... }
      
      @@
      function func;
      identifier dev;
      expression E1, E2;
      @@
      func(struct drm_device *dev, ...)
      {
       ...
       drm_helper_mode_fill_fb_struct(
      +				dev,
      				E1, E2);
       ...
      }
      
      @@
      expression E1, E2;
      @@
       drm_helper_mode_fill_fb_struct(
      +				dev,
      				E1, E2);
      
      v2: Rerun spatch 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: NAlex Deucher <alexander.deucher@amd.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1481748539-18283-1-git-send-email-ville.syrjala@linux.intel.com
      a3f913ca
    • V
      drm/radeon: Use DIV_ROUND_UP() · 3a6176e7
      Ville Syrjälä 提交于
      Use DIV_ROUND_UP() instead of hand rolling it. Just a drive-by change.
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-4-git-send-email-ville.syrjala@linux.intel.com
      3a6176e7
    • V
      drm/radeon: Add local 'fb' variables · 489f3267
      Ville Syrjälä 提交于
      Add a local 'fb' variable to a few places to get rid of the
      'crtc->primary->fb' stuff. Looks neater and helps me with my poor
      coccinelle skills later.
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-3-git-send-email-ville.syrjala@linux.intel.com
      489f3267
  5. 07 12月, 2016 5 次提交
  6. 05 12月, 2016 1 次提交
  7. 29 11月, 2016 1 次提交
    • A
      drm/radeon: fix check for port PM availability · bcfdd5d5
      Alex Deucher 提交于
      The ATPX method does not always exist on the dGPU, it may be located at
      the iGPU. The parent device of the iGPU is the root port for which
      bridge_d3 is false. This accidentally enables the legacy PM method which
      conflicts with port PM and prevented the dGPU from powering on.
      
      Ported from amdgpu commit:
      drm/amdgpu: fix check for port PM availability
      from Peter Wu.
      
      Fixes: d3ac31f3 (drm/radeon: fix power state when port pm is unavailable (v2))
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: Peter Wu <peter@lekensteyn.nl>
      Cc: <stable@vger.kernel.org> # 4.8+
      bcfdd5d5
  8. 24 11月, 2016 1 次提交
  9. 14 11月, 2016 1 次提交
  10. 12 11月, 2016 1 次提交
  11. 01 11月, 2016 1 次提交
    • L
      drm/radeon: Fix kernel panic on shutdown · 0a6e2105
      Larry Finger 提交于
      Since commit a481daa8 ("drm/radeon: always apply pci shutdown
      callbacks"), a Dell Latitude D600 laptop has crashed on shutdown. The
      PCI Identification of the graphics adapter is "VGA compatible controller
      [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV250/M9 GL [Mobility
      FireGL 9000/Radeon 9000] [1002:4c66] (rev 01)".
      
      Prior to commit b0c80bd5 ("drm/radeon: fix up dp aux tear down (v2)"),
      I have no idea where the panic happened as the screen was blanked before
      the crash.  Since that more recent change, the panic has been in routine
      radeon_connector_unregister(), and has been shown to be due to a NULL
      value in the ddc_bus member of struct drm_connector.
      
      Bug: https://bugzilla.kernel.org/show_bug.cgi?id=178421
      Fixes: a481daa8 ("drm/radeon: always apply pci shutdown callbacks")
      Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      0a6e2105
  12. 31 10月, 2016 1 次提交
  13. 27 10月, 2016 1 次提交
  14. 26 10月, 2016 7 次提交
  15. 25 10月, 2016 2 次提交
  16. 21 10月, 2016 1 次提交
  17. 19 10月, 2016 1 次提交
  18. 18 10月, 2016 1 次提交
  19. 14 10月, 2016 1 次提交
  20. 13 10月, 2016 3 次提交
  21. 04 10月, 2016 1 次提交
    • M
      drm/radeon: Prevent races on pre DCE4 between flip submission and completion. · 363926dc
      Mario Kleiner 提交于
      Pre DCE4 hw doesn't have reliable pageflip completion
      interrupts, so instead polling for flip completion is
      used from within the vblank irq handler to complete
      page flips.
      
      This causes a race if pageflip ioctl is called close to
      vblank:
      
      1. pageflip ioctl queues execution of radeon_flip_work_func.
      
      2. vblank irq fires, radeon_crtc_handle_vblank checks for
         flip_status == FLIP_SUBMITTED finds none, no-ops.
      
      3. radeon_flip_work_func runs inside vblank, decides to
         set flip_status == FLIP_SUBMITTED and programs the
         flip into hw.
      
      4. hw executes flip immediately (because in vblank), but
         as 2 already happened, the flip completion routine only
         emits the flip completion event one refresh later ->
         wrong vblank count/timestamp for completion and no
         performance gain, as instead of delaying the flip until
         next vblank, we now delay the next flip by 1 refresh
         while waiting for the delayed flip completion event.
      
      Given we often don't gain anything due to this race, but
      lose precision, prevent the programmed flip from executing
      in vblank on pre DCE4 asics to avoid this race.
      
      On pre-AVIVO hw we can't program the hw for edge-triggered
      flips, they always execute anywhere in vblank. Therefore delay
      the actual flip programming until after vblank on pre-AVIVO.
      Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: NMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      363926dc