@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $asset-pipeline: false) {
  @if $asset-pipeline {
    background-image: image-url("#{$filename}.#{$extension}");
  }
  @else {
    background-image: url("#{$filename}.#{$extension}");
  }

  @include hidpi {

    @if $asset-pipeline {
      @if $retina-filename {
        background-image: image-url("#{$retina-filename}.#{$extension}");
      }
      @else {
        background-image: image-url("#{$filename}@2x.#{$extension}");
      }
    }

    @else {
      @if $retina-filename {
        background-image: url("#{$retina-filename}.#{$extension}");
      }
      @else {
        background-image: url("#{$filename}@2x.#{$extension}");
      }
    }

    background-size: $background-size;

  }
}

@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-extension: _2x, $asset-pipeline: false) {
  @if $asset-pipeline {
    background-image: image-url("#{$filename}.#{$extension}");
  }
  @else {
    background-image:       url("#{$filename}.#{$extension}");
  }

  @include hidpi {
    @if $asset-pipeline {
      @if $retina-filename {
        background-image: image-url("#{$retina-filename}.#{$extension}");
      }
      @else {
        background-image: image-url("#{$filename}#{$retina-extension}.#{$extension}");
      }
    }

    @else {
      @if $retina-filename {
        background-image: url("#{$retina-filename}.#{$extension}");
      }
      @else {
        background-image: url("#{$filename}#{$retina-extension}.#{$extension}");
      }
    }

    background-size: $background-size;

  }
}

Fix merge conflicts. Added custom retina suffix.
Fix merge conflicts. Added custom retina suffix.
