All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Wajdeczko" <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 3/5] drm/i915: Add common fixed16_16 values
Date: Fri, 22 Dec 2017 16:51:49 +0100	[thread overview]
Message-ID: <op.zbnnonl8xaggs7@mwajdecz-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <151394609812.16779.13509286010367393272@mail.alporthouse.com>

On Fri, 22 Dec 2017 13:34:58 +0100, Chris Wilson  
<chris@chris-wilson.co.uk> wrote:

> Quoting Michal Wajdeczko (2017-12-22 12:25:54)
>> Zero and One are additional commonly used values that
>> can have its own definitions.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/fixed16_16.h | 15 ++++++++++++---
>>  drivers/gpu/drm/i915/intel_pm.c   | 22 +++++++++++-----------
>>  2 files changed, 23 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/fixed16_16.h  
>> b/drivers/gpu/drm/i915/fixed16_16.h
>> index ec859c0..af23997 100644
>> --- a/drivers/gpu/drm/i915/fixed16_16.h
>> +++ b/drivers/gpu/drm/i915/fixed16_16.h
>> @@ -31,9 +31,18 @@
>>         u32 val;
>>  } fixed16_16_t;
>>
>> -#define FP_16_16_MAX ({ \
>> -       fixed16_16_t fp; \
>> -       fp.val = UINT_MAX; \
>> +#define FIXED16_16_ZERO ({ \
>> +       fixed16_16_t fp = { .val = 0 }; \
>> +       fp; \
>> +})
>
> #define TO_FIXED16_16(x) (fixed16_16_t){ .val = (x) }

Earlier I was thinking about __FIXED16_16_INITIALIZER(v)
but decided to not introduce it due potential abuse ;)

> #define FIXED16_16_ZERO TO_FIXED16_16(0)
> #define FIXED16_16_ONE TO_FIXED16_16(1)

Gotcha! It should be 1 << 16

> #define FIXED16_16_MAX TO_FIXED16_16(U32_MAX)
>
> ?
> -Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-12-22 15:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22 12:25 [PATCH 0/5] drm/i915: promote fixed16_16 Michal Wajdeczko
2017-12-22 12:25 ` [PATCH 1/5] drm/i915: Move uint_fixed_16_16_t to its own header Michal Wajdeczko
2017-12-22 12:25 ` [PATCH 2/5] drm/i915: Rename uint_fixed_16_16_t to fixed16_16_t Michal Wajdeczko
2017-12-22 16:08   ` Michal Wajdeczko
2017-12-22 17:11     ` Chris Wilson
2017-12-22 17:11       ` Chris Wilson
2017-12-22 12:25 ` [PATCH 3/5] drm/i915: Add common fixed16_16 values Michal Wajdeczko
2017-12-22 12:34   ` Chris Wilson
2017-12-22 15:51     ` Michal Wajdeczko [this message]
2017-12-22 16:03       ` Chris Wilson
2017-12-22 12:25 ` [PATCH 4/5] drm/i915: Fix overflows in fixed16_16 Michal Wajdeczko
2017-12-22 12:39   ` Chris Wilson
2017-12-22 15:56     ` Michal Wajdeczko
2017-12-22 12:25 ` [PATCH 5/5] drm/i915: Tidy up fixed16_16 Michal Wajdeczko
2017-12-22 12:43   ` Chris Wilson
2017-12-22 12:52 ` ✓ Fi.CI.BAT: success for drm/i915: promote fixed16_16 Patchwork
2017-12-22 14:23 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.zbnnonl8xaggs7@mwajdecz-mobl1.ger.corp.intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.