1. 06 4月, 2017 1 次提交
  2. 01 3月, 2017 1 次提交
  3. 23 1月, 2017 1 次提交
  4. 15 12月, 2016 3 次提交
    • 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/mgag200: Add local 'fb' variable · 72952757
      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: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-5-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      72952757
  5. 01 12月, 2016 1 次提交
  6. 07 6月, 2016 1 次提交
  7. 01 6月, 2016 1 次提交
  8. 05 3月, 2016 1 次提交
  9. 16 2月, 2016 1 次提交
  10. 15 12月, 2015 1 次提交
  11. 11 12月, 2015 1 次提交
  12. 17 11月, 2015 1 次提交
  13. 24 8月, 2015 2 次提交
  14. 17 7月, 2015 1 次提交
  15. 16 6月, 2015 1 次提交
  16. 07 4月, 2015 1 次提交
  17. 05 11月, 2014 1 次提交
  18. 06 8月, 2014 1 次提交
    • C
      drm: Perform cmdline mode parsing during connector initialisation · eaf99c74
      Chris Wilson 提交于
      i915.ko has a custom fbdev initialisation routine that aims to preserve
      the current mode set by the BIOS, unless overruled by the user. The
      user's wishes are determined by what, if any, mode is specified on the
      command line (via the video= parameter). However, that command line mode
      is first parsed by drm_fb_helper_initial_config() which is called after
      i915.ko's custom initial_config() as a fallback method. So in order for
      us to honour it, we need to move the cmdline parser earlier. If we
      perform the connector cmdline parsing as soon as we initialise the
      connector, that cmdline mode and forced status is then available even if
      the fbdev helper is not compiled in or never called.
      
      We also then expose the cmdline user mode in the connector mode lists.
      
      v2: Rebase after connector->name upheaval.
      
      v3: Adapt mga200 to look for the cmdline mode in the new place. Nicely
      simplifies things while at that.
      
      v4: Fix checkpatch.
      
      v5: Select FB_CMDLINE to adapt to the changed fbdev patch.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73154
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2)
      Cc: dri-devel@lists.freedesktop.org
      Cc: Julia Lemire <jlemire@matrox.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eaf99c74
  19. 18 7月, 2014 1 次提交
  20. 19 6月, 2014 1 次提交
  21. 02 4月, 2014 1 次提交
    • M
      drm: Replace crtc fb with primary plane fb (v3) · f4510a27
      Matt Roper 提交于
      Now that CRTC's have a primary plane, there's no need to track the
      framebuffer in the CRTC.  Replace all references to the CRTC fb with the
      primary plane's fb.
      
      This patch was generated by the Coccinelle semantic patching tool using
      the following rules:
      
              @@ struct drm_crtc C; @@
              -   (C).fb
              +   C.primary->fb
      
              @@ struct drm_crtc *C; @@
              -   (C)->fb
              +   C->primary->fb
      
      v3: Generate patch via coccinelle.  Actual removal of crtc->fb has been
          moved to a subsequent patch.
      
      v2: Fixup several lingering crtc->fb instances that were missed in the
          first patch iteration.  [Rob Clark]
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      f4510a27
  22. 05 2月, 2014 1 次提交
  23. 14 1月, 2014 1 次提交
    • R
      drivers: gpu: Mark functions as static in mgag200_mode.c · 080fd6b5
      Rashika 提交于
      Mark functions mga_set_start_address(), mga_encoder_destroy() and
      mga_connector_best_encoder() as static in drm/mgag200/mgag200_mode.c
      because they are not used outside this file.
      
      This eliminates the following warnings in drm/mgag200/mgag200_mode.c:
      drivers/gpu/drm/mgag200/mgag200_mode.c:694:6: warning: no previous
      prototype for ‘mga_set_start_address’ [-Wmissing-prototypes]
      drivers/gpu/drm/mgag200/mgag200_mode.c:1401:6: warning: no previous
      prototype for ‘mga_encoder_destroy’ [-Wmissing-prototypes]
      drivers/gpu/drm/mgag200/mgag200_mode.c:1561:21: warning: no previous
      prototype for ‘mga_connector_best_encoder’ [-Wmissing-prototypes]
      Signed-off-by: NRashika Kheria <rashika.kheria@gmail.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      080fd6b5
  24. 08 11月, 2013 1 次提交
  25. 30 7月, 2013 4 次提交
  26. 28 6月, 2013 1 次提交
  27. 17 6月, 2013 1 次提交
    • C
      drm/mgag200: Hardware cursor support · a080db9f
      Christopher Harvey 提交于
      G200 cards support, at best, 16 colour palleted images for the cursor
      so we do a conversion in the cursor_set function, and reject cursors
      with more than 16 colours, or cursors with partial transparency. Xorg
      falls back gracefully to software cursors in this case.
      
      We can't disable/enable the cursor hardware without causing momentary
      corruption around the cursor. Instead, once the cursor is on we leave
      it on, and simulate turning the cursor off by moving it
      offscreen. This works well.
      
      Since we can't disable -> update -> enable the cursors, we double
      buffer cursor icons, then just move the base address that points to
      the old cursor, to the new. This also works well, but uses an extra
      page of memory.
      
      The cursor buffers are lazily-allocated on first cursor_set. This is
      to make sure they don't take priority over any framebuffers in case of
      limited memory.
      
      Here is a representation of how the bitmap for the cursor is mapped in G200 memory :
      
        Each line of color cursor use 6 Slices of 8 bytes. Slices 0 to 3
        are used for the 4bpp bitmap, slice 4 for XOR mask and slice 5 for
        AND mask. Each line has the following format:
      
            //      Byte 0  Byte 1  Byte 2  Byte 3  Byte 4  Byte 5  Byte 6 Byte 7
            //
            // S0:  P00-01  P02-03  P04-05  P06-07  P08-09  P10-11  P12-13 P14-15
            // S1:  P16-17  P18-19  P20-21  P22-23  P24-25  P26-27  P28-29 P30-31
            // S2:  P32-33  P34-35  P36-37  P38-39  P40-41  P42-43  P44-45 P46-47
            // S3:  P48-49  P50-51  P52-53  P54-55  P56-57  P58-59  P60-61 P62-63
            // S4:  X63-56  X55-48  X47-40  X39-32  X31-24  X23-16  X15-08 X07-00
            // S5:  A63-56  A55-48  A47-40  A39-32  A31-24  A23-16  A15-08 A07-00
            //
            //       S0 to S5      = Slices 0 to 5
            //       P00 to P63    = Bitmap - pixels 0 to 63
            //       X00 to X63    = always 0 - pixels 0 to 63
            //       A00 to A63    = transparent markers - pixels 0 to 63
            //                       1 means colour, 0 means transparent
      Signed-off-by: NChristopher Harvey <charvey@matrox.com>
      Signed-off-by: NMathieu Larouche <mathieu.larouche@matrox.com>
      Acked-by: NJulia Lemire <jlemire@matrox.com>
      Tested-by: NJulia Lemire <jlemire@matrox.com>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      a080db9f
  28. 03 6月, 2013 1 次提交
  29. 13 5月, 2013 4 次提交
  30. 30 4月, 2013 1 次提交
  31. 10 4月, 2013 1 次提交