Image copyright Weinstein Company/Paramount Pictures Image caption Dev Patel is nominated for Lion and Viola Davis is nominated for Fences

After the #OscarsSoWhite controversies of the last two years, 2017 promises to be a more diverse affair.

In the acting categories there are a total of seven nominees from ethnic minority backgrounds.

Denzel Washington is nominated as best actor for Fences and Ruth Negga as best actress for Loving.

Moonlight's Mahershala Ali and Lion's Dev Patel are up for best supporting actor.

The supporting actress category includes Viola Davis for Fences, Naomie Harris for Moonlight and Octavia Spencer for Hidden Figures.

Image copyright Altitude Film Image caption Moonlight has eight Oscar nominations

Three of the nine films up for best picture - Fences, Hidden Figures and Moonlight - feature predominantly black casts.

In Fences, based on August Wilson's play, Washington plays a sanitation worker and former professional baseball player struggling to provide for his family against a backdrop of strained race relations in 1950s Pittsburgh.

Hidden Figures is the behind-the-scenes story of three African-American women who helped launch Nasa's first successful space missions in the 1960s.

Moonlight is about a gay African-American man grappling with his sexuality in an impoverished neighbourhood of Miami.

In the directing category, Moonlight's Barry Jenkins is only the fourth black best director nominee in Oscar history.

Media playback is unsupported on your device Media caption This year, non-white actors have received seven Oscar nominations

The first was John Singleton, nominated in 1992 for Boyz n the Hood. He was followed by Lee Daniels, for Precious in 2010, and 12 Years a Slave's Steve McQueen in 2014. McQueen's film won best picture but he lost the best director prize to Gravity's Alfonso Cuaron.

In the documentary feature category, Ava DuVernay's 13th is up against I Am Not Your Negro from Raoul Peck and Ezra Edelman's OJ: Made In America. (With a running time of seven hours and 47 minutes, OJ is the longest film ever nominated for an Academy Award.)

A long time coming

The two-year diversity drought in the acting categories inspired the #OscarsSoWhite backlash on social media.

Of course, most of this year's nominated films were already in production well before that furore erupted.

Moonlight's Jenkins has told the BBC his film was not a response to the #OscarsSoWhite criticism, having conceived the project "at least three-and-a-half years ago".

But the outcry did lead the Academy of Motion Picture Arts and Sciences, which awards the Oscars, to take steps to make its membership more diverse.

Image copyright Focus Features Image caption Ruth Negga in Loving

Has that made a difference this year? Hollywood Reporter's Oscars guru Scott Feinberg thinks not.

"The Academy may claim that this is the result of it flooding its organization with an unprecedented number of diverse new members this year, but I maintain that these nominees, up against the same competition, would have been nominated in either of the last two years," he writes in his Oscars analysis.

In June 2016, the Academy invited almost 700 new members to join, with a focus on women and ethnic minorities.

One of those new members is British film director Amma Asante, whose film about an interracial marriage A United Kingdom opened the London Film Festival.

She told me last year that the organisers of the Oscars needed to keep up the momentum on its actions to improve diversity.

"I don't know the change happens overnight," she said.

"I'm interested to see what will happen in two Oscars' time."

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.